CountStr

Report any Hollywood bugs here
Post Reply
GMKai
Posts: 140
Joined: Mon Feb 15, 2010 10:58 am

CountStr

Post 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
plouf
Posts: 467
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: CountStr

Post 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 ""
Christos
Post Reply