Anyone using dot notation with strings?
Posted
#1
(In Topic #1086)
Regular

Posted
Guru

Len(TmpStr) is not a static gb.util/String.class method it's a built in function like Mid() and InStr().
If you think something should be added to a wiki page ,,, add it <EMOJI seq="1f609" tseq="1f609">😉</EMOJI>
Posted
Regular

The gb.String class is a set of static utility functions to specifically handle UTF character strings, a String variable is a "normal" ASCII string.
Since gb.String is essentially a static "class" i.e. it has no visible attributes, you cannot declare an object of that type, as is clearly indicated by the "This class is static." comment in the wiki.
I see no need for any changes to the wiki.
hth
bruce
Posted
Guru

With your logic then theoretically also Mid() and InStr(), etc would be expected to work UTF-8 strings too?
But no I think it makes sense.
As it stands Mid(), InStr(), Len(), etc are all for plain ascii
String.Mid(), String.InStr(), String.Len(), etc are all for UTF-8
Respects
Posted
Guru

But if I start typing .Len, then no such warning is shown on the help screen (/comp/gb/_boxedstring/len - Gambas Documentation).
I have added the same warning to the Wiki. This should show up in a day or 2.
1 guest and 0 members have just viewed this.


