Symbol count in string
#1

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?
Reply
#2

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)