国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

characters

_.camelCase(string='')

轉(zhuǎn)換string

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回駝峰字符串。

_.camelCase('Foo Bar');// => 'fooBar'
 _.camelCase('--foo-bar--');// => 'fooBar'
 _.camelCase('__FOO_BAR__');// => 'fooBar'

_.capitalize(string='')

將第一個(gè)字符轉(zhuǎn)換string為大寫(xiě),其余轉(zhuǎn)換為小寫(xiě)。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要大寫(xiě)的字符串。

返回

(字符串):返回大寫(xiě)的字符串。

_.capitalize('FRED');// => 'Fred'

_.deburr(string='')

string通過(guò)將拉丁文補(bǔ)充-1(https://en.wikipedia.org/wiki/Latin-1 補(bǔ)編(Unicode_block%29#Character_table)和拉丁字母擴(kuò)充-A字母基本拉丁字母和除去組合變音符號(hào)。

Since

3.0.0

參數(shù)
  1. [string=''] (字符串):去毛刺的字符串。

返回

(字符串):返回去毛刺字符串。

_.deburr('déjà vu');// => 'deja vu'

_.endsWith(string='', target, position=string.length)

檢查是否string以給定的目標(biāo)字符串結(jié)束。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要檢查的字符串。

  2. [target] (字符串):要搜索的字符串。

  3. [position=string.length] (數(shù)字):最多搜索的位置。

返回

(boolean):返回true如果stringtargetelse      結(jié)束false。

_.endsWith('abc', 'c');// => true
 _.endsWith('abc', 'b');// => false
 _.endsWith('abc', 'b', 2);// => true

_.escape(string='')

將字符“&”,“<”,“>”,“”和“'” string轉(zhuǎn)換為其對(duì)應(yīng)的HTML實(shí)體。

注意:沒(méi)有其他字符被轉(zhuǎn)義。為了逃避額外的角色,請(qǐng)使用像這樣的第三方庫(kù)。

雖然“>”字符為了對(duì)稱而被轉(zhuǎn)義,但像“>”和“/”這樣的字符不需要在HTML中轉(zhuǎn)義,除非它們是標(biāo)記或未加引號(hào)屬性值的一部分,否則沒(méi)有特殊含義。有關(guān)更多詳細(xì)信息,請(qǐng)參閱Mathias Bynens的文章 (在“半相關(guān)趣味事實(shí)”下)

使用HTML時(shí),應(yīng)始終引用屬性值以減少XSS向量。

以來(lái)

0.1.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)義的字符串。

返回

(字符串):返回轉(zhuǎn)義字符串。

_.escape('fred, barney, & pebbles');// => 'fred, barney, &amp; pebbles'

_.escapeRegExp(string='')

轉(zhuǎn)義RegExp特殊字符“^”,“$”,“”,“?!保?”,“+”,“?”,“(”,“)”,“”,“”,“{”,“ }“和”|“ 中string

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)義的字符串。

返回

(字符串):返回轉(zhuǎn)義字符串。

_.escapeRegExp('[lodash](https://lodash.com/)');// => '\[lodash\]\(https://lodash\.com/\)'

_.kebabCase(string='')

轉(zhuǎn)換string為Kebab的情況。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回烤肉串字符串。

_.kebabCase('Foo Bar');// => 'foo-bar'
 _.kebabCase('fooBar');// => 'foo-bar'
 _.kebabCase('__FOO_BAR__');// => 'foo-bar'

_.lowerCase(string='')

string以空格分隔的字詞轉(zhuǎn)換為小寫(xiě)字母。

以來(lái)

4.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回下方的字符串。

_.lowerCase('--Foo-Bar--');// => 'foo bar'
 _.lowerCase('fooBar');// => 'foo bar'
 _.lowerCase('__FOO_BAR__');// => 'foo bar'

_.lowerFirst(string='')

將第一個(gè)字符轉(zhuǎn)換string為小寫(xiě)。

以來(lái)

4.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回轉(zhuǎn)換后的字符串。

_.lowerFirst('Fred');// => 'fred'
 _.lowerFirst('FRED');// => 'fRED'

_.pad(string='', length=0, chars=' ')

string如果它短于左側(cè)和右側(cè)墊length。如果填充字符不能被平均分割,則會(huì)被截?cái)?code>length。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要填充的字符串。

  2. [length=0] (數(shù)字):填充長(zhǎng)度。

  3. [chars=' '] (字符串):用作填充的字符串。

返回

(字符串):返回填充的字符串。

_.pad('abc', 8);// => '  abc   '
 _.pad('abc', 8, '_-');// => '_-abc_-_'
 _.pad('abc', 3);// => 'abc'

_.padEnd(string='', length=0, chars=' ')

string右側(cè),如果它比短length。填充字符如果超過(guò),則會(huì)被截?cái)?code>length。

以來(lái)

4.0.0

參數(shù)
  1. [string=''] (字符串):要填充的字符串。

  2. [length=0] (數(shù)字):填充長(zhǎng)度。

  3. [chars=' '] (字符串):用作填充的字符串。

返回

(string): Returns the padded string.

_.padEnd('abc', 6);// => 'abc   '
 _.padEnd('abc', 6, '_-');// => 'abc_-_'
 _.padEnd('abc', 3);// => 'abc'

_.padStart(string ='',length = 0,chars ='')

string左側(cè),如果是比較短的length。填充字符如果超過(guò),則會(huì)被截?cái)?code>length。

自從

4.0.0

參數(shù)
  1. [string=''] (字符串):要填充的字符串。

  2. [length=0] (數(shù)字):填充長(zhǎng)度。

  3. [chars=' '] (字符串):用作填充的字符串。

返回

(字符串):返回填充的字符串。

示例
_.padStart('abc', 6);// => '   abc'
 _.padStart('abc', 6, '_-');// => '_-_abc'
 _.padStart('abc', 3);// => 'abc'

_.parseInt(string, radix=10)

轉(zhuǎn)換string為指定基數(shù)的整數(shù)。如果radixundefined或      0,一個(gè)radix10使用,除非value是一個(gè)十六進(jìn)制,在這種情況下radix16使用。

注意:此方法與ES5的實(shí)現(xiàn)一致parseInt。

以來(lái)

1.1.0

參數(shù)
  1. string (字符串):要轉(zhuǎn)換的字符串。

  2. [radix=10] (數(shù)字):解釋的基數(shù)value

返回

(數(shù)字):返回轉(zhuǎn)換后的整數(shù)。

_.parseInt('08');// => 8
 _.map(['6', '08', '10'], _.parseInt);// => [6, 8, 10]

_.repeat(string ='',n = 1)

重復(fù)給定的字符串n時(shí)間。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要重復(fù)的字符串。

  2. [n=1] (數(shù)字):重復(fù)字符串的次數(shù)。

返回

(字符串):返回重復(fù)的字符串。

_.repeat('*', 3);// => '***'
 _.repeat('abc', 2);// => 'abcabc'
 _.repeat('abc', 0);// => ''

_.replace(string ='',pattern,replacement)

替換比賽為patternstring與      replacement。

注意:此方法基于String#replace。

以來(lái)

4.0.0

參數(shù)
  1. [string=''] (字符串):要修改的字符串。

  2. pattern (RegExp | string):要替換的模式。

  3. replacement (功能|字符串):匹配替換。

返回

(字符串):返回修改后的字符串。

_.replace('Hi Fred', 'Fred', 'Barney');// => 'Hi Barney'

_.snakeCase(string='')

轉(zhuǎn)換string為蛇的情況。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回蛇字符串。

_.snakeCase('Foo Bar');// => 'foo_bar'
 _.snakeCase('fooBar');// => 'foo_bar'
 _.snakeCase('--FOO-BAR--');// => 'foo_bar'

_.split(string='', separator, limit)

拆分stringseparator。

注意:此方法基于String#split

版本

4.0.0

參數(shù)
  1. [string=''] (string): The string to split.

  2. separator (RegExp|string): The separator pattern to split by.

  3. [limit] (number): The length to truncate results to.

返回

(數(shù)組):返回字符串段。

_.split('a-b-c', '-', 2);// => ['a', 'b']

_.startCase(string='')

轉(zhuǎn)換string為啟動(dòng)大小寫(xiě)。

以來(lái)

3.1.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回值

(字符串):返回開(kāi)始的套用字符串。

_.startCase('--foo-bar--');// => 'Foo Bar'
 _.startCase('fooBar');// => 'Foo Bar'
 _.startCase('__FOO_BAR__');// => 'FOO BAR'

_.startsWith(string='', target, position=0)

檢查是否string從給定的目標(biāo)字符串開(kāi)始。

以來(lái)

3.0.0

參數(shù)
  1. [string=''] (字符串):要檢查的字符串。

  2. [target] (字符串):要搜索的字符串。

  3. [position=0] (數(shù)字):從中搜索的位置。

返回

(boolean):返回true如果stringtargetelse 開(kāi)始false。

_.startsWith('abc', 'a');// => true
 _.startsWith('abc', 'b');// => false
 _.startsWith('abc', 'b', 1);// => true

_.template(string='', options={})

創(chuàng)建一個(gè)編譯的模板函數(shù),可以在“插入”分隔符中插入數(shù)據(jù)屬性,在“轉(zhuǎn)義”分隔符中插入HTML轉(zhuǎn)義插值數(shù)據(jù)屬性,并在“評(píng)估”分隔符中執(zhí)行JavaScript。數(shù)據(jù)屬性可以作為模板中的自由變量來(lái)訪問(wèn)。如果給定設(shè)置對(duì)象,則優(yōu)先于      _.templateSettings值。

注意:在開(kāi)發(fā)版本中,_.template利用sourceURL來(lái)更容易地進(jìn)行調(diào)試。

有關(guān)預(yù)編譯模板的更多信息,請(qǐng)參閱lodash的自定義構(gòu)建文檔。

有關(guān)Chrome擴(kuò)展程序沙箱的更多信息,請(qǐng)參閱Chrome的擴(kuò)展程序文檔。

版本

0.1.0

參數(shù)
  1. [string=''] (string): The template string.

  2. [options={}] (Object): The options object.

  3. [options.escape=_.templateSettings.escape] (RegExp): The HTML "escape" delimiter.

  4. [options.evaluate=_.templateSettings.evaluate] (RegExp): The "evaluate" delimiter.

  5. [options.imports=_.templateSettings.imports] (Object): An object to import into the         template as free variables.

  6. [options.interpolate=_.templateSettings.interpolate] (RegExp): The "interpolate"         delimiter.

  7. [options.sourceURL='lodash.templateSources[n]'] (string): The sourceURL of the compiled         template.

  8. [options.variable='obj'] (string): The data object variable name.

返回

(功能):返回已編譯的模板功能。

// Use the "interpolate" delimiter to create a compiled template.var compiled = _.template('hello <%= user %>!');compiled({ 'user': 'fred' });// => 'hello fred!' // Use the HTML "escape" delimiter to escape data property values.var compiled = _.template('<b><%- value %></b>');compiled({ 'value': '<script>' });// => '<b>&amplt;script&ampgt;</b>' // Use the "evaluate" delimiter to execute JavaScript and generate HTML.var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');compiled({ 'users': ['fred', 'barney'] });// => '<li>fred</li><li>barney</li>' // Use the internal `print` function in "evaluate" delimiters.var compiled = _.template('<% print("hello " + user); %>!');compiled({ 'user': 'barney' });// => 'hello barney!' // Use the ES template literal delimiter as an "interpolate" delimiter.// Disable support by replacing the "interpolate" delimiter.var compiled = _.template('hello ${ user }!');compiled({ 'user': 'pebbles' });// => 'hello pebbles!' // Use backslashes to treat delimiters as plain text.var compiled = _.template('<%= "\\<%- value %\\>" %>');compiled({ 'value': 'ignored' });// => '<%- value %>' // Use the `imports` option to import `jQuery` as `jq`.var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';var compiled = _.template(text, { 'imports': { 'jq': jQuery } });compiled({ 'users': ['fred', 'barney'] });// => '<li>fred</li><li>barney</li>' // Use the `sourceURL` option to specify a custom sourceURL for the template.var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });compiled(data);// => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. // Use the `variable` option to ensure a with-statement isn't used in the compiled template.var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });compiled.source;// => function(data) {//   var __t, __p = '';//   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';//   return __p;// } // Use custom template delimiters._.templateSettings.interpolate = /{{([\s\S]+?)}}/g;var compiled = _.template('hello {{ user }}!');compiled({ 'user': 'mustache' });// => 'hello mustache!' // Use the `source` property to inline compiled templates for meaningful// line numbers in error messages and stack traces.fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\  var JST = {\    "main": ' + _.template(mainText).source + '\  };\

');

_.toLower(string='')

string整體而言,轉(zhuǎn)換為小寫(xiě)字母,就像String#toLowerCase一樣。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回下方的字符串。

_.toLower('--Foo-Bar--');// => '--foo-bar--'
 _.toLower('fooBar');// => 'foobar'
 _.toLower('__FOO_BAR__');// => '__foo_bar__'

_.toUpper(string='')

string整體轉(zhuǎn)換為大寫(xiě)字母,就像String#toUpperCase一樣。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回上方的字符串。

_.toUpper('--foo-bar--');// => '--FOO-BAR--'
 _.toUpper('fooBar');// => 'FOOBAR'
 _.toUpper('__foo_bar__');// => '__FOO_BAR__'

_.trim(string='', chars=whitespace)

從中刪除前導(dǎo)和尾部的空格或指定的字符string

版本

3.0.0

參數(shù)
  1. [string=''] (字符串):要修剪的字符串。

  2. [chars=whitespace] (字符串):要修剪的字符。

返回

(字符串):返回修剪后的字符串。

_.trim('  abc  ');// => 'abc'
 _.trim('-_-abc-_-', '_-');// => 'abc'
 _.map(['  foo  ', '  bar  '], _.trim);// => ['foo', 'bar']

_.trimEnd(string ='',chars = whitespace)

從中刪除尾部空白或指定的字符string。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要修剪的字符串。

  2. [chars=whitespace] (字符串):要修剪的字符。

返回

(字符串):返回修剪后的字符串。

_.trimEnd('  abc  ');// => '  abc'
 _.trimEnd('-_-abc-_-', '_-');// => '-_-abc'

_.trimStart(string='', chars=whitespace)

從中刪除前導(dǎo)空格或指定的字符string。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要修剪的字符串。

  2. [chars=whitespace] (字符串):要修剪的字符。

返回

(字符串):返回修剪后的字符串。

_.trimStart('  abc  ');// => 'abc  '
 _.trimStart('-_-abc-_-', '_-');// => 'abc-_-'

_.truncate(string='', options={})

string如果它長(zhǎng)于給定的最大字符串長(zhǎng)度,則截?cái)?。截?cái)嘧址淖詈笠粋€(gè)字符被替換為缺省為“...”的省略字符串。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要截?cái)嗟淖址?/p>

  2. [options={}] (對(duì)象):選項(xiàng)對(duì)象。

  3. [options.length=30] (數(shù)字):最大字符串長(zhǎng)度。

  4. [options.omission='...'] (字符串):省略表示文本的字符串。

  5. [options.separator] (RegExp | string):要截?cái)嗟姆指舴J健?/p>

返回

(字符串):返回截?cái)嗟淖址?/p>

_.truncate('hi-diddly-ho there, neighborino');// => 'hi-diddly-ho there, neighbo...'
 _.truncate('hi-diddly-ho there, neighborino', {  'length': 24,  'separator': ' '});// => 'hi-diddly-ho there,...'
 _.truncate('hi-diddly-ho there, neighborino', {  'length': 24,  'separator': /,? +/});// => 'hi-diddly-ho there...'
 _.truncate('hi-diddly-ho there, neighborino', {  'omission': ' [...]'});// => 'hi-diddly-ho there, neig [...]'

_.unescape(string='')

相反的_.escape; 這種方法的HTML實(shí)體轉(zhuǎn)換      &ampamp;,&amplt;,&ampgt;,&ampquot;,和      &amp#39;string其對(duì)應(yīng)的字符。

注意:沒(méi)有其他HTML實(shí)體未轉(zhuǎn)義。為了避免額外的HTML實(shí)體使用像這樣的第三方庫(kù)。

版本

0.6.0

參數(shù)
  1. [string=''] (字符串):unescape的字符串。

返回

(字符串):返回未轉(zhuǎn)義的字符串。

_.unescape('fred, barney, &amp; pebbles');// => 'fred, barney, & pebbles'

_.upperCase(string='')

string以空格分隔的字詞轉(zhuǎn)換為大寫(xiě)字母。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回上方的字符串。

_.upperCase('--foo-bar');// => 'FOO BAR'
 _.upperCase('fooBar');// => 'FOO BAR'
 _.upperCase('__foo_bar__');// => 'FOO BAR'

_.upperFirst(string='')

將第一個(gè)字符轉(zhuǎn)換string為大寫(xiě)。

版本

4.0.0

參數(shù)
  1. [string=''] (字符串):要轉(zhuǎn)換的字符串。

返回

(字符串):返回轉(zhuǎn)換后的字符串。

_.upperFirst('fred');// => 'Fred'
 _.upperFirst('FRED');// => 'FRED'

_.words(string='', pattern)

拆分string成它的單詞的數(shù)組。

版本

3.0.0

參數(shù)
  1. [string=''] (字符串):要檢查的字符串。

  2. [pattern] (RegExp | string):匹配單詞的模式。

返回

(數(shù)組):返回單詞string。

_.words('fred, barney, & pebbles');// => ['fred', 'barney', 'pebbles']
 _.words('fred, barney, & pebbles', /[^, ]+/g);// => ['fred', 'barney', '&', 'pebbles']
Previous article: Next article: