Bump to v3.1.0.

This commit is contained in:
jdalton
2015-02-01 22:03:53 -08:00
committed by John-David Dalton
parent 3b2df88eab
commit 1608d89174
21 changed files with 118 additions and 58 deletions

29
string/startCase.js Normal file
View File

@@ -0,0 +1,29 @@
define(['../internal/createCompounder'], function(createCompounder) {
/**
* Converts `string` to start case.
* See [Wikipedia](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage)
* for more details.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the start cased string.
* @example
*
* _.startCase('--foo-bar');
* // => 'Foo Bar'
*
* _.startCase('fooBar');
* // => 'Foo Bar'
*
* _.startCase('__foo_bar__');
* // => 'Foo Bar'
*/
var startCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
});
return startCase;
});