Travis build: 200
This commit is contained in:
@ -1784,7 +1784,7 @@ byte_size('Hello World') # 11
|
||||
|
||||
Converts a string to camelcase.
|
||||
|
||||
Use `re.sub()` to replace any `-`,`_` or ` ` (space) with a space, using the regexp `r"(_|-)+"`.
|
||||
Use `re.sub()` to replace any `-` or `_` with a space, using the regexp `r"(_|-)+"`.
|
||||
Use `title()` to capitalize the first letter of each word convert the rest to lowercase.
|
||||
Finally, use `replace()` to remove spaces between words.
|
||||
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
"type": "snippetListing",
|
||||
"title": "camel",
|
||||
"attributes": {
|
||||
"text": "Converts a string to camelcase.\n\nUse `re.sub()` to replace any `-`,`_` or ` ` (space) with a space, using the regexp `r\"(_|-)+\"`.\nUse `title()` to capitalize the first letter of each word convert the rest to lowercase.\nFinally, use `replace()` to remove spaces between words.\n\n",
|
||||
"text": "Converts a string to camelcase.\n\nUse `re.sub()` to replace any `-` or `_` with a space, using the regexp `r\"(_|-)+\"`.\nUse `title()` to capitalize the first letter of each word convert the rest to lowercase.\nFinally, use `replace()` to remove spaces between words.\n\n",
|
||||
"tags": [
|
||||
"string",
|
||||
"regexp",
|
||||
@ -122,7 +122,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "9df97be0166e2a4a90859e878f986c0adb539ac41b85aac9c05e4dd0999155b5"
|
||||
"hash": "190d14b2ccad05dde990bb29617f7464a0e37f6c2523f1fb2c47fe18d45973fc"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
"type": "snippet",
|
||||
"attributes": {
|
||||
"fileName": "camel.md",
|
||||
"text": "Converts a string to camelcase.\n\nUse `re.sub()` to replace any `-`,`_` or ` ` (space) with a space, using the regexp `r\"(_|-)+\"`.\nUse `title()` to capitalize the first letter of each word convert the rest to lowercase.\nFinally, use `replace()` to remove spaces between words.\n\n",
|
||||
"text": "Converts a string to camelcase.\n\nUse `re.sub()` to replace any `-` or `_` with a space, using the regexp `r\"(_|-)+\"`.\nUse `title()` to capitalize the first letter of each word convert the rest to lowercase.\nFinally, use `replace()` to remove spaces between words.\n\n",
|
||||
"codeBlocks": {
|
||||
"code": "import re\n\ndef camel(s):\n s = re.sub(r\"(_|-)+\", \" \", s).title().replace(\" \", \"\")\n return s[0].lower() + s[1:]",
|
||||
"example": "camel('some_database_field_name'); # 'someDatabaseFieldName'\ncamel('Some label that needs to be camelized'); # 'someLabelThatNeedsToBeCamelized'\ncamel('some-javascript-property'); # 'someJavascriptProperty'\ncamel('some-mixed_string with spaces_underscores-and-hyphens'); # 'someMixedStringWithSpacesUnderscoresAndHyphens'"
|
||||
@ -162,7 +162,7 @@
|
||||
]
|
||||
},
|
||||
"meta": {
|
||||
"hash": "9df97be0166e2a4a90859e878f986c0adb539ac41b85aac9c05e4dd0999155b5"
|
||||
"hash": "190d14b2ccad05dde990bb29617f7464a0e37f6c2523f1fb2c47fe18d45973fc"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user