From e90fa5db21bf10c0ab8208ad4839cb3a8e8d12f5 Mon Sep 17 00:00:00 2001 From: Gaddeti Rohit Babu <30732419+rohitbabugaddeti@users.noreply.github.com> Date: Sat, 2 Nov 2019 13:11:52 +0530 Subject: [PATCH] updated documentation the regexp is not having any pattern to match a space. Hence changed the documentation accordingly. --- snippets/camel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/camel.md b/snippets/camel.md index f11f41507..01dbf1181 100644 --- a/snippets/camel.md +++ b/snippets/camel.md @@ -5,7 +5,7 @@ tags: string,regexp,intermediate 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.