By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,605 Members | 1,370 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,605 IT Pros & Developers. It's quick & easy.

Finding the first nonblank character in a string using C++

P: 8
I have created some code using fstream to extract a string from a file but the string contains many blanks and spaces. an example of the string is:-

E2_PCU_90V "The 90v rail PWM trim value"

I need to print out 'E2_PCU_90V' and 'The 90v rail PWM trim value' as two different strings. I know that I need to find the position of the first non blank and then the position of the first blank and create a string with the contents in between the two markers. Then do then find the first " and the last " and create a second string with the info in between the speach marks.

I am extremly stuck.

Thank you

Lana
Nov 16 '06 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
I have created some code using fstream to extract a string from a file but the string contains many blanks and spaces. an example of the string is:-

E2_PCU_90V "The 90v rail PWM trim value"

I need to print out 'E2_PCU_90V' and 'The 90v rail PWM trim value' as two different strings. I know that I need to find the position of the first non blank and then the position of the first blank and create a string with the contents in between the two markers. Then do then find the first " and the last " and create a second string with the info in between the speach marks.

I am extremly stuck.

Thank you

Lana
Perhaps you can get ideas here

http://www.thescripts.com/forum/thread564238.html
Nov 16 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.