-
September 15th, 2009, 02:29 PM
#1
Strings
Hi
Code:
if ((strchr(", \n\r\t", chunckOfData[i])) ........
how to add to the string ", \n\r\t" also " type of simbol. I want to check also if chunckOfData[i] isn't ".
Thankyou in advice.
Share and always try to give back more.
-
September 15th, 2009, 02:37 PM
#2
Re: Strings
Obviously english isn't your first language, I'm not quite sure that I understand your question, but I will say that you should probably be using std::string instead of char*, they are much easier and flexible. Adding strings is as simple as doing string1+string2;
Code:
bool isChunkQuote = ChunkofData == '\"';
-
September 15th, 2009, 02:41 PM
#3
Re: Strings
Yes. My English isn't that good. But I will try my best
Simple example.
" \n\t\r"
" " \n\t\r"
And how to put it in this construction if ((strchr(", \n\r\t", chunckOfData[i])) ........
Then I was toying with php some years ago I know it was posible like " \n\r/"/" or something like this...
So I think C++ should have something similar.
Share and always try to give back more.
-
September 15th, 2009, 03:44 PM
#4
Re: Strings
Originally Posted by ulumulu
I want to check also if chunckOfData[i] isn't ".
Basically, you are asking how to escape the double quote within a string literal? If so, then the answer is that you should escape it by prepending a backslash, e.g., ", \n\r\t\\".
-
September 15th, 2009, 03:47 PM
#5
Re: Strings
Originally Posted by laserlight
Basically, you are asking how to escape the double quote within a string literal? If so, then the answer is that you should escape it by prepending a backslash, e.g., ", \n\r\t\\".
Nice.
did like this " \n\r\\"\" and worked like a charm.
Thankyou laserLight.
Share and always try to give back more.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|