- Jun 16, 2000
- 30,213
- 12
- 81
string first = input.substr(input.find(',') + 2, input.find(':'));
input is a string in the format
LastName, FirstName: Score
the code extracts the first name...I've used almost that exact same piece of code in a previous assignment...but for some reason, it starts at the right position, but then goes till the end of the string. I checked, the find routine is returning the right position in the string...but it isn't working. Example...
Davis, Mark: 100
will extract the first name as
Mark: 100
why? urg
			
			input is a string in the format
LastName, FirstName: Score
the code extracts the first name...I've used almost that exact same piece of code in a previous assignment...but for some reason, it starts at the right position, but then goes till the end of the string. I checked, the find routine is returning the right position in the string...but it isn't working. Example...
Davis, Mark: 100
will extract the first name as
Mark: 100
why? urg
 
				
		 
			 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		
 Facebook
Facebook Twitter
Twitter