From 15b9b6fe5b7e423221aaa4c21c4dfd5fd61fa497 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Sat, 2 Nov 2019 08:57:57 +0000 Subject: [PATCH] Travis build: 200 --- README.md | 2 +- snippet_data/snippetList.json | 4 ++-- snippet_data/snippets.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bde6255c4..5c687dfe0 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 83e350d41..17a7de3fc 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -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" } }, { diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index 71f61f1d3..1eb1f86cf 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -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" } }, {