Click here to Skip to main content
15,905,967 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to insert multiple values in string efficiently? Pin
AFSEKI7-May-07 2:02
AFSEKI7-May-07 2:02 
AnswerRe: How to insert multiple values in string efficiently? Pin
gumi_r@msn.com7-May-07 5:26
gumi_r@msn.com7-May-07 5:26 
QuestionStuck with Network Pin
ThanhND3076-May-07 3:23
ThanhND3076-May-07 3:23 
QuestionReduce multiple characters to one, in a string! Pin
Adeel Chaudhry6-May-07 3:18
Adeel Chaudhry6-May-07 3:18 
AnswerRe: Reduce multiple characters to one, in a string! Pin
Rob Graham6-May-07 4:03
Rob Graham6-May-07 4:03 
GeneralRe: Reduce multiple characters to one, in a string! Pin
Luc Pattyn6-May-07 4:12
sitebuilderLuc Pattyn6-May-07 4:12 
GeneralRe: Reduce multiple characters to one, in a string! Pin
Adeel Chaudhry6-May-07 4:17
Adeel Chaudhry6-May-07 4:17 
GeneralRe: Reduce multiple characters to one, in a string! Pin
Rob Graham6-May-07 4:40
Rob Graham6-May-07 4:40 
You are right, this would work better:
string test = "this  string   has    multiple    spaces      .";
StringBuilder sb = new StringBuilder(test);
int l1 = sb.Length;
int l2 = l1 +1;
while (l1 != l2)
{
    l1 = sb.Length;
    sb.Replace("  ", " ");
    l2 = sb.Length;
}
string result = sb.ToString();



GeneralRe: Reduce multiple characters to one, in a string! Pin
Luc Pattyn6-May-07 5:25
sitebuilderLuc Pattyn6-May-07 5:25 
GeneralRe: Reduce multiple characters to one, in a string! Pin
Adeel Chaudhry6-May-07 4:15
Adeel Chaudhry6-May-07 4:15 
AnswerRe: Reduce multiple characters to one, in a string! Pin
Guffa6-May-07 4:25
Guffa6-May-07 4:25 
GeneralRe: Reduce multiple characters to one, in a string! Pin
Adeel Chaudhry6-May-07 4:36
Adeel Chaudhry6-May-07 4:36 
GeneralRe: Reduce multiple characters to one, in a string! Pin
PIEBALDconsult6-May-07 6:52
mvePIEBALDconsult6-May-07 6:52 
AnswerRe: Reduce multiple characters to one, in a string! Pin
PIEBALDconsult6-May-07 4:41
mvePIEBALDconsult6-May-07 4:41 
GeneralRe: Reduce multiple characters to one, in a string! Pin
Adeel Chaudhry6-May-07 4:54
Adeel Chaudhry6-May-07 4:54 
GeneralRe: Reduce multiple characters to one, in a string! Pin
PIEBALDconsult6-May-07 4:57
mvePIEBALDconsult6-May-07 4:57 
AnswerRe: Reduce multiple characters to one, in a string! Pin
AFSEKI7-May-07 2:09
AFSEKI7-May-07 2:09 
QuestionTreeview challenge Pin
Rick van Woudenberg6-May-07 3:07
Rick van Woudenberg6-May-07 3:07 
AnswerRe: Treeview challenge Pin
Arun.Immanuel6-May-07 3:54
Arun.Immanuel6-May-07 3:54 
GeneralRe: Treeview challenge Pin
Rick van Woudenberg6-May-07 4:23
Rick van Woudenberg6-May-07 4:23 
JokeRe: Treeview challenge Pin
PIEBALDconsult6-May-07 5:03
mvePIEBALDconsult6-May-07 5:03 
GeneralRe: Treeview challenge Pin
Rick van Woudenberg6-May-07 9:31
Rick van Woudenberg6-May-07 9:31 
GeneralRe: Treeview challenge Pin
PIEBALDconsult6-May-07 18:18
mvePIEBALDconsult6-May-07 18:18 
QuestionPlugIns - Preventing Malicious Code... Pin
Shy Agam6-May-07 2:49
Shy Agam6-May-07 2:49 
AnswerRe: PlugIns - Preventing Malicious Code... Pin
PIEBALDconsult6-May-07 18:20
mvePIEBALDconsult6-May-07 18:20 

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.