is there any way to have a string, lets say 10 characters long, and read each character individually?
The typical approach is to convert it to an array of bytes and wire to a loop to index one character after the other, or to a grown index node to access many at once. The conversion functions for string are in the string palette to the bottom right.
Greg McKaskle
ok thanks. after a little looking around i found out that in order to take the string of that one character and not the number, i have to use type cast (which i have never used before)
Sorry my other post was so short – tablets and typing …
For a little background, a string is identical to an array of characters. So you can convert or cast it back and forth freely depending on which API is more appropriate. The string API is far better for scanning for sequences and patterns, but the array API is sometimes useful for precision work like getting out arbitrary characters and treating them as ASCII bytes.
If you want to extract a portion of a string, even a single character, but still treat it as a string, I’d suggest the string subset node. Indicate which byte and use a size of one. Another useful technique once you have a portion of a string extracted is to wire them to a case structure. The case will switch on Booleans, ints, enums, and strings. You can enter in string elements comma separated to use for matching.
If you need more assistance, be sure to explain more about what you are trying to do.
Greg McKaskle
the string subset is so much easier. i forgot to use the length input before, so thats why i couldn’t figure out how to do it. Thanks for all of your help:D