.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 17th, 2003, 12:46 PM
Jair's Avatar
Jair Jair is offline
Don't fear the penguins!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: arborlon.gingle.net
Posts: 147 Jair User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 sec
Reputation Power: 10
Send a message via MSN to Jair Send a message via Yahoo to Jair
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.

Reply With Quote
  #2  
Old October 17th, 2003, 02:51 PM
Jair's Avatar
Jair Jair is offline
Don't fear the penguins!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: arborlon.gingle.net
Posts: 147 Jair User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 sec
Reputation Power: 10
Send a message via MSN to Jair Send a message via Yahoo to Jair
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);

Reply With Quote
  #3  
Old October 17th, 2003, 09:14 PM
oni9 oni9 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Brisbane, Australia
Posts: 50 oni9 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
I thought you can use String.Trim(char[]) for the same purpose...
Comments on this post
Gran Roguismo agrees!

Reply With Quote
  #4  
Old October 20th, 2003, 03:27 PM
Jair's Avatar
Jair Jair is offline
Don't fear the penguins!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: arborlon.gingle.net
Posts: 147 Jair User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 sec
Reputation Power: 10
Send a message via MSN to Jair Send a message via Yahoo to Jair
Quote:
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Between the Quotes

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap