Click here to Skip to main content
15,920,801 members
Home / Discussions / C#
   

C#

 
QuestionHow to remove characters from string value Pin
ShilpaKumari23-Jan-11 5:21
ShilpaKumari23-Jan-11 5:21 
AnswerRe: How to remove characters from string value Pin
PIEBALDconsult23-Jan-11 5:25
mvePIEBALDconsult23-Jan-11 5:25 
AnswerRe: How to remove characters from string value [modified] Pin
RaviRanjanKr23-Jan-11 5:26
professionalRaviRanjanKr23-Jan-11 5:26 
GeneralRe: How to remove characters from string value Pin
Henry Minute23-Jan-11 5:33
Henry Minute23-Jan-11 5:33 
GeneralRe: How to remove characters from string value Pin
RaviRanjanKr23-Jan-11 5:36
professionalRaviRanjanKr23-Jan-11 5:36 
GeneralRe: How to remove characters from string value Pin
Henry Minute23-Jan-11 5:39
Henry Minute23-Jan-11 5:39 
GeneralRe: How to remove characters from string value Pin
RaviRanjanKr23-Jan-11 5:41
professionalRaviRanjanKr23-Jan-11 5:41 
GeneralRe: How to remove characters from string value Pin
Henry Minute23-Jan-11 5:45
Henry Minute23-Jan-11 5:45 
One addition to your code
C#
string str = "abc, d.e f,g h,i. j,k";
string[] arr = str.Split(',', '.'); // remove all , and .
foreach (string str1 in arr)
{
    Console.Write(str1);
}
Console.Write(str);  //<=================== Added line prints original string


What do you get when you run that?

The commas and stops are still there. So, once again I say, your code does not remove those characters as the OP asked.
Henry Minute

Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I wouldn't let CG touch my Abacus!

GeneralRe: How to remove characters from string value Pin
RaviRanjanKr23-Jan-11 5:53
professionalRaviRanjanKr23-Jan-11 5:53 
GeneralRe: How to remove characters from string value Pin
PIEBALDconsult23-Jan-11 6:37
mvePIEBALDconsult23-Jan-11 6:37 
GeneralRe: How to remove characters from string value Pin
Not Active23-Jan-11 6:05
mentorNot Active23-Jan-11 6:05 
GeneralRe: How to remove characters from string value Pin
RaviRanjanKr23-Jan-11 6:12
professionalRaviRanjanKr23-Jan-11 6:12 
GeneralRe: How to remove characters from string value Pin
ShilpaKumari23-Jan-11 5:38
ShilpaKumari23-Jan-11 5:38 
GeneralRe: How to remove characters from string value Pin
RaviRanjanKr23-Jan-11 5:43
professionalRaviRanjanKr23-Jan-11 5:43 
GeneralRe: How to remove characters from string value Pin
Not Active23-Jan-11 6:00
mentorNot Active23-Jan-11 6:00 
GeneralRe: How to remove characters from string value Pin
PIEBALDconsult23-Jan-11 6:44
mvePIEBALDconsult23-Jan-11 6:44 
GeneralRe: How to remove characters from string value-[Minor Changes] Pin
RaviRanjanKr25-Jan-11 4:38
professionalRaviRanjanKr25-Jan-11 4:38 
AnswerRe: How to remove characters from string value Pin
Estys23-Jan-11 5:27
Estys23-Jan-11 5:27 
AnswerRe: How to remove characters from string value Pin
RaviRanjanKr23-Jan-11 6:16
professionalRaviRanjanKr23-Jan-11 6:16 
AnswerRe: How to remove characters from string value [modified] Pin
Abhinav S23-Jan-11 6:38
Abhinav S23-Jan-11 6:38 
GeneralRe: How to remove characters from string value Pin
Richard MacCutchan23-Jan-11 8:22
mveRichard MacCutchan23-Jan-11 8:22 
JokeRe: How to remove characters from string value Pin
Not Active23-Jan-11 10:19
mentorNot Active23-Jan-11 10:19 
GeneralRe: How to remove characters from string value Pin
Abhinav S23-Jan-11 17:30
Abhinav S23-Jan-11 17:30 
AnswerRe: How to remove characters from string value Pin
Paladin200024-Jan-11 3:54
Paladin200024-Jan-11 3:54 
QuestionBuild and use user control (vs 2010) Pin
ladoota22-Jan-11 20:13
ladoota22-Jan-11 20:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.