<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">Le dim. 23 sept. 2018 09:28, Benoît Minisini <<a href="mailto:g4mba5@gmail.com">g4mba5@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Since last commit, I allowed strings to be used like objects.<br>
<br>
This is not syntactic sugar, as it is entirely implemented in the <br>
interpreter.<br>
<br>
So now, if S is a string, you can do the following:<br>
<br>
S[N] to get the N-th character of the string. Beware! Contrary to string <br>
subroutines, the first character position is zero. It's like using the <br>
string as a character array.<br>
<br>
S[N, L] is an equivalent of Mid$(S, N + 1, L).<br>
<br>
S.Len returns the length of the string.<br>
<br>
S[] only deals with byte position, it can't handle UTF-8.<br>
<br>
That new syntax is slower than calling directly Mid$() and Len(), but I <br>
don't think we will notice the difference.<br>
<br>
Maybe I will add a S.Max property to returns the length minus one, but I <br>
don't think I will implement all the string routines as object methods.<br>
<br>
Tell me what you think about that.<br></blockquote></div></div><div dir="auto">I think it's coool but I want all the string functions 😊</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-- <br>
Benoît Minisini<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div></div></div>