is there a quick way of taking out the first few letters of an ansistring? i.e.
String astring = abcdef;
temp = astring[1 to 3];
temp stores only abc
is there a quick way of taking out the first few letters of an ansistring? i.e.
String astring = abcdef;
temp = astring[1 to 3];
temp stores only abc
Might want to bookmark this page.. it's highly useful for documentation with the most popular STL classes.string substr (size_type pos, size_type n);
Returns a substring of the current string, starting at position pos and of length n:
string str18 = "abcdefghi"
string str19 = str18.substr (6,2);
cout << str19 << endl; // "gh"
http://www.msoe.edu/eecs/ce/courseinfo/stl/