C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 07-05-2008, 04:29 PM   #1
Registered User
 
Join Date: Jun 2008
Posts: 10
deleting charector from a string

OK is it possable to delete an charactor from a string, ' " ' and ' , ' to be persise, now i got a feeling you can but, i have no idea how or even where to begin. any help would be helpful.

also as a side note, where is the best place ot find C# tutorals? because what i've found so far, tend to be over the top or strang.
linoukus is offline   Reply With Quote
Old 07-05-2008, 04:43 PM   #2
Confused
 
Magos's Avatar
 
Join Date: Sep 2001
Location: Sweden
Posts: 3,125
Strings are immutable so you can't actually remove it, you can however create a new string with those characters removed.
Code:
string NewString = OldString.Replace("\"", "").Replace(",", "");
If performance is an issue it might be better to use a StringBuilder instead.
__________________
MagosX.com

Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Magos is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom String class gives problem with another prog. I BLcK I C++ Programming 1 12-18-2006 03:40 AM
Linked List Help CJ7Mudrover C Programming 9 03-10-2004 10:33 PM
Classes inheretance problem... NANO C++ Programming 12 12-09-2002 03:23 PM
creating class, and linking files JCK C++ Programming 12 12-08-2002 02:45 PM
Warnings, warnings, warnings? spentdome C Programming 25 05-27-2002 06:49 PM


All times are GMT -6. The time now is 02:19 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22