#1
  1. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12

    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.
  2. #2
  3. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    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.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Brisbane, Australia
    Posts
    50
    Rep Power
    11
    I thought you can use String.Trim(char[]) for the same purpose...

    Comments on this post

    • Gran Roguismo agrees
  6. #4
  7. Don't fear the penguins!
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    arborlon.gingle.net
    Posts
    147
    Rep Power
    12
    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.

IMN logo majestic logo threadwatch logo seochat tools logo