Page 1 of 1

Case insensitive CountString

Posted: Wed Dec 03, 2025 5:25 pm
by spikey
Could CountString get the same Mode parameter as FindString please?
Help wrote:#PB_String_CaseSensitive: case sensitive search (a=a) (default).
#PB_String_NoCase : case insensitive search (A=a).
I currently have to have two copies of a string around for counting, original case and lower case.

Re: Case insensitive CountString

Posted: Wed Dec 03, 2025 6:29 pm
by TI-994A
spikey wrote: Wed Dec 03, 2025 5:25 pm Could CountString get the same Mode parameter as FindString please?
Help wrote:#PB_String_CaseSensitive: case sensitive search (a=a) (default).
#PB_String_NoCase : case insensitive search (A=a).
I currently have to have two copies of a string around for counting, original case and lower case.


In the meantime, this works without any duplication:

Code: Select all

Debug CountString(UCase("How many 'ow' contains Bow ?"), "OW") ; will display 3

Re: Case insensitive CountString

Posted: Wed Dec 03, 2025 8:27 pm
by spikey
Of course, but it's an optimisation that it would be nice to have available and makes the two commands consistent.