Created
May 17, 2020 06:10
-
-
Save sanjitk7/04cae0a6e07f4b12f90d9894acf3aecd to your computer and use it in GitHub Desktop.
Function to Check if String is in camelCase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#check if the word is in camel case | |
#ip: "helloWorld" | |
#op: True | |
def isCamelCase(word): | |
#check for whitespaces | |
res = bool(re.search(r"\s", word)) | |
if (not res): | |
x = re.search(r"^[a-z](.+?)([A-Z])",word) | |
if (x): | |
return True | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment