Posts: 1,113
Threads: 127
Joined: Jul 2008
Reputation:
0
Hello,how do I count how many letters and numbers ar there in a string?For example.
format(string,sizeof(string)"Hello 2 u"); There are 9symbols (inluding spaces). And how do I auto find it? Is there some function for that?
Posts: 966
Threads: 5
Joined: Jul 2011
Reputation:
0
In runtime code, you can find the amount of characters in a string using the strlen function, which I assume you already know. How this function works is it iterates through the string until it discovers a terminating character (aka the null character), then returns the iterator value.
But if you're asking on how to evaluate it prior to compilation, I think you'd be good off using an advanced text editor such as Notepad++ which will display the amount of characters highlighted on the bottom of your editor window.