arduino_new:
Isn't that strchr() return a char pointer? you can use arithmetic on that pointer but I think you still need to do extra checking for it to work.
But it is bright enough to work out for itself how long the string is.
AWOL:
But it is bright enough to work out for itself how long the string is.
original post had an array of char instead of a cstring.
I was under the impression that he had an array of char instead of a cstring. But he had neither.
(tried them out this time. they work.)
(As long as you're REALLY SURE that the string contains a '', you don't need extra checking. But Bad Things Might Happen if there is no '' and you later count on having the null termination there...)