-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added IsLower and isUpper and wordCount string methods #724
Added IsLower and isUpper and wordCount string methods #724
Conversation
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
Signed-off-by: Brian Downs <brian.downs@gmail.com>
I would have done it like you have now to be honest, methods on the string and always return a boolean value (regardless of string length!) I'll get round to reviewing them, sorry for being slow on this mate been a bit hectic in last few days |
No rush. Thanks! |
Actually hold on I think I misunderstood your initial question. You're returning false if the string is greater than 1, not if it's 0. I would expect these methods to still return true if the string length is more than 1 but all characters are lower case, e.g Same way it works in Python for example: https://www.programiz.com/python-programming/methods/string/islower |
Signed-off-by: Brian Downs <brian.downs@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being slow on this, thank you for doing it!
What's Changed:
Added IsLower and isUpper string methods. Since these methods are to be ran on single character strings, I returned false if the string length is more than 1 however I can see a case for returning or causing a runtime error. I'll defer to you (@Jason2605) for that final say. We can also create an optional "strings" module that contains extra utility functions and this could go in there.
Type of Change:
Housekeeping:
Screenshots (If Applicable):