Filter string chars

Hi,

I would like to be able to filter string characters for example if I have a string named "hello123" I would like to be able to grab the first letter and store it and the second letter. So char1 = 'h' and char2 = 'e'. Obviously the word will be different each time and I only need the first 2 characters, any simple way to achieve this?
Are you using C-style char arrays, or STL string objects, or some other data type?
sorry just using a c++ string but just assumed it would be easier to throw the filtered strings into char's as they are single character
Last edited on
Topic archived. No new replies allowed.