Filtering characters out of string

Hello, i am using visaul c++ 2010
please help how to get specified character from
String^ "1545+2-33"
for example second character 5 is needed for further if comparisons to seperate numbers and calculations

It would be good if integer could specify number of character to take values from strin.

1
2
3
4
5
6
7
8
9
10
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {

                  
				 String^ all = "1545+2-33";//example

				 int charcounter;	//char count to choose



			 }
First of all, this is not C++. This is C++/CLI, Microsoft language with C++-like syntax.

Second, I think, I did not get your question, but you can get specific character from a string using subscript operator:
1
2
string x = "hello";
x[1] = 'a'; // x now is "hallo" 
Topic archived. No new replies allowed.