Re: [Dev-C++] Problem with string.....
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jeremy H. <jer...@co...> - 2005-02-17 09:59:27
|
Farzan Hajian wrote: > Is there any function in C/C++ that can return string containing a > specified number of characters from the right side of another string? > I assume you mean something like this: string s = 'this_is_a_string'; And you want, say, 'string'. You can do this: string result = s.substr(s.size() - 6); There's a lot of other stuff you can do with strings. Here's a few string pages. Basic: http://www.msoe.edu/eecs/ce/courseinfo/stl/string.htm http://www.bgsu.edu/departments/compsci/docs/string.html More detailed: http://www.sgi.com/tech/stl/basic_string.html http://www.yolinux.com/TUTORIALS/LinuxTutorialC++StringClass.html |