All topics about ZGameEditor goes here.
Moderator: Moderators
-
Ats
- Posts: 829
- Joined: Fri Sep 28, 2012 10:05 am
-
Contact:
Post
by Ats »
Hi everyone,
I'm currently working on a high score table for Omeganaut, and I have a new basic question:
Is there a simple way to get the length of a string var?
And what about the length of an int?
Thanks for your insights

-
Kjell
- Posts: 1935
- Joined: Sat Feb 23, 2008 11:15 pm
Post
by Kjell »
Hi Ats,
Ats wrote: ↑Fri Feb 04, 2022 2:01 pmIs there a simple way to get the length of a string var?
Sure, just use length()
Code: Select all
string myString = "Hello";
int myStringLength = length(myString);
Ats wrote: ↑Fri Feb 04, 2022 2:01 pmAnd what about the length of an int?
Same thing, just convert your int to a string first before using length()
Code: Select all
int myInt = 12345;
int myIntLength = length(intToStr(myInt));
K
-
Ats
- Posts: 829
- Joined: Fri Sep 28, 2012 10:05 am
-
Contact:
Post
by Ats »
Oh, right !!!!
Thanks, sorry for that
