Page 1 of 1

CountStr

Posted: Sun Sep 25, 2022 1:49 pm
by GMKai

Code: Select all

Local number = 123556.56
DebugPrint(number)
n = CountStr(number,".")
DebugPrint(n)
n = CountStr(number,'.')
DebugPrint(n)

Code: Select all

123556.56
1
0
Why does the result differ?
Both Count are expected to be 1.
Tested with MorphOS 3.17 and Hollywood 9.1

Re: CountStr

Posted: Sun Sep 25, 2022 2:17 pm
by plouf
Double quotes are the ONLY container for strings

Single quote is for single character and represends the character code i.e 'A' = 65

Corectly thought countste only finds a dot with ""