Kaushal Modi
24df909d8a
Make isUpper (and variants) work for strings with non-alpha chars
...
The other variants are isLower, isUpperAscii and isLowerAscii
Fixes https://github.com/nim-lang/Nim/issues/7963 .
This commit changes the behavior and signatures of:
- isUpper, isLower in the unicode module
- isUpperAscii, isLowerAscii in the strutils module
A second mandatory parameter skipNonAlpha is added to these 4 procs.
(This change affects only for the case where the input is a *string*.)
---
With skipNonAlpha set to true, the behavior mimics the Python isupper and
islower behavior i.e. non-alphabetic chars/runes are ignored when checking if
the string is upper-case or lower-case.
Before this commit:
doAssert(not isUpper("A B"))
After this commit:
doAssert(not isUpper("A B", false)) <-- old behavior
doAssert isUpper("A B", true)
Below two are equivalent:
isUpper("A B", true)
isAlpha("A B") and isUpper("A B", false)
.. and the similar for other 3 procs.
2018-06-08 15:14:29 -04:00
..
2018-06-08 19:29:19 +03:00
2018-05-14 11:40:59 +02:00
2018-05-05 21:45:07 +02:00
2018-04-12 17:42:33 +02:00
2015-09-04 23:03:56 +02:00
2018-05-29 07:28:15 +03:00
2018-01-05 16:40:51 +02:00
2018-02-23 19:16:11 +01:00
2015-02-03 09:04:24 +01:00
2018-03-17 15:21:22 +00:00
2016-09-25 13:11:02 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-06-06 19:18:24 +03:00
2018-05-05 21:45:07 +02:00
2017-07-05 12:54:09 +02:00
2018-04-30 02:52:58 +02:00
2017-12-03 15:20:50 +01:00
2017-11-19 03:29:26 +01:00
2018-05-05 21:45:07 +02:00
2018-05-25 00:04:30 +03:00
2018-06-01 11:20:28 -04:00
2018-04-30 02:52:58 +02:00
2017-03-02 14:53:50 +01:00
2015-10-01 12:05:45 -07:00
2018-04-15 23:38:43 +02:00
2018-05-05 21:45:07 +02:00
2017-07-07 08:10:39 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2017-01-05 15:13:57 +01:00
2018-05-05 21:45:07 +02:00
2018-04-25 02:41:16 +02:00
2018-04-06 11:59:49 +02:00
2018-05-05 21:45:07 +02:00
2018-04-12 13:54:49 +02:00
2018-05-05 21:45:07 +02:00
2018-05-22 23:07:02 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-06-06 00:36:56 +03:00
2018-04-15 19:59:11 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-04-30 02:52:58 +02:00
2018-06-05 11:15:04 -04:00
2017-09-16 10:57:21 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-06-07 21:10:00 +03:00
2018-05-05 21:45:07 +02:00
2015-02-03 09:04:24 +01:00
2017-03-14 15:45:35 +01:00
2018-05-05 21:45:07 +02:00
2018-05-06 10:55:19 +02:00
2018-06-04 14:56:56 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2016-07-21 08:53:10 +01:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-05-18 01:49:49 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-05-25 18:52:04 +03:00
2018-05-05 21:45:07 +02:00
2018-05-23 10:23:19 +03:00
2016-07-21 08:52:39 +01:00
2018-04-25 02:43:26 +02:00
2018-06-01 11:19:25 -04:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2018-02-06 17:40:31 +01:00
2017-03-26 09:30:59 +02:00
2018-05-05 21:45:07 +02:00
2018-05-05 21:45:07 +02:00
2015-02-03 09:04:24 +01:00
2018-05-05 21:45:07 +02:00
2018-05-25 08:48:09 +03:00
2018-06-05 00:09:07 -04:00
2018-04-23 11:02:38 +02:00
2018-05-30 23:49:56 +03:00
2018-05-05 21:45:07 +02:00
2018-06-08 15:14:29 -04:00
2018-05-05 21:45:07 +02:00
2018-04-13 17:45:58 +02:00
2018-05-07 09:37:49 +02:00
2018-06-06 13:10:56 +03:00
2017-11-15 17:34:48 +01:00
2018-06-08 15:14:29 -04:00
2018-05-28 05:24:04 +03:00
2018-05-05 21:45:07 +02:00
2017-01-25 20:02:19 +01:00
2018-05-07 09:37:49 +02:00
2015-09-04 23:03:56 +02:00
2018-05-05 21:45:07 +02:00
2018-05-23 16:28:53 +02:00