Added IsLower and isUpper and wordCount string methods#724
Added IsLower and isUpper and wordCount string methods#724Jason2605 merged 5 commits intodictu-lang:developfrom
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>
Jason2605
left a comment
There was a problem hiding this comment.
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):