October 17th, 2003, 12:46 PM
-
Between the Quotes
Stuck twice already... I'm on a role here. Right. Well, anyways, I'm reading a line of text out of a file. This line has a part of that has a pair of double quotes in it. What I'm trying to do is pull out only the part thats between the quotes. So, does anyone know of any magic way to do this, or do I have little other choice but to cut it up based on the positions of the first two quotes in the string?
Thanks for any help!
Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.
To the systems programmer, users and applications serve only to provide a test load.
October 17th, 2003, 02:51 PM
-
Umkay, nevermind. I was just being dense and blind (as usual
) and didnt see the String.Substring :P. Here's what I did, in case anyone else has a similar problem
Code:
iFirstQuote = sLine.IndexOf("\\'");
iSecondQuote = sLine.LastIndexOf("\\'");
sLine.Substring(iFirstQuote+1, (iSecondQuote-iFirstQuote)-1);
Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.
To the systems programmer, users and applications serve only to provide a test load.
October 17th, 2003, 09:14 PM
-
I thought you can use String.Trim(char[]) for the same purpose...
Comments on this post
October 20th, 2003, 03:27 PM
-
Originally posted by oni9
I thought you can use String.Trim(char[]) for the same purpose...
I think that .Trim will remove any occurances of a specific character. But there's prolly some exceedingly clever way to use it to do what I'm trying to do.
Every morning, I get up and look through the Forbes list of the richest people in America. If I'm not there, I go to work.
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.
To the systems programmer, users and applications serve only to provide a test load.