Click here to Skip to main content
15,902,911 members
Home / Discussions / C#
   

C#

 
AnswerRe: Remove multiple blanks in a string? Pin
lainoo31-Jan-05 1:58
lainoo31-Jan-05 1:58 
GeneralRe: Remove multiple blanks in a string? Pin
Syntaxo31-Jan-05 2:36
Syntaxo31-Jan-05 2:36 
GeneralRe: Remove multiple blanks in a string? Pin
mav.northwind31-Jan-05 2:49
mav.northwind31-Jan-05 2:49 
GeneralRe: Remove multiple blanks in a string? Pin
Syntaxo31-Jan-05 3:07
Syntaxo31-Jan-05 3:07 
GeneralRe: Remove multiple blanks in a string? Pin
mav.northwind31-Jan-05 5:07
mav.northwind31-Jan-05 5:07 
GeneralRe: Remove multiple blanks in a string? Pin
Syntaxo31-Jan-05 5:27
Syntaxo31-Jan-05 5:27 
GeneralRe: Remove multiple blanks in a string? Pin
mav.northwind31-Jan-05 6:15
mav.northwind31-Jan-05 6:15 
AnswerRe: Remove multiple blanks in a string? Pin
Corinna John31-Jan-05 2:51
Corinna John31-Jan-05 2:51 
//split string
String[] parts = strIn.split(' ');

//re-build string
StringBuilder newString = new StringBuilder();
for(int n=0; n<parts.Length; n++){
  if(parts[n].Length > 0){
     newString.Append(parts[n]);
     newString.Append(" ");
  }
}

//remove trailing space and return
newString.Remove(newString.Length-1, 1);
return newString.ToString();


_________________________________
Vote '1' if you're too lazy for a discussion

GeneralRe: Remove multiple blanks in a string? Pin
Syntaxo31-Jan-05 3:42
Syntaxo31-Jan-05 3:42 
AnswerRe: Remove multiple blanks in a string? Pin
leppie31-Jan-05 7:32
leppie31-Jan-05 7:32 
Generalconnect to mySQL Pin
Jassim Rahma31-Jan-05 0:57
Jassim Rahma31-Jan-05 0:57 
GeneralRe: connect to mySQL Pin
Colin Angus Mackay31-Jan-05 5:16
Colin Angus Mackay31-Jan-05 5:16 
GeneralDisplaying Interactive Diagrams Pin
Mridang Agarwalla31-Jan-05 0:14
Mridang Agarwalla31-Jan-05 0:14 
GeneralRe: Displaying Interactive Diagrams Pin
DavieB31-Jan-05 4:50
DavieB31-Jan-05 4:50 
GeneralRe: Displaying Interactive Diagrams Pin
Steve Maier31-Jan-05 10:43
professionalSteve Maier31-Jan-05 10:43 
GeneralRe: Displaying Interactive Diagrams Pin
Mridang Agarwalla1-Feb-05 19:55
Mridang Agarwalla1-Feb-05 19:55 
GeneralRe: Displaying Interactive Diagrams Pin
Steve Maier2-Feb-05 4:39
professionalSteve Maier2-Feb-05 4:39 
GeneralSQL transactions commit and rollback Pin
ppp00130-Jan-05 21:52
ppp00130-Jan-05 21:52 
GeneralRe: SQL transactions commit and rollback Pin
lainoo31-Jan-05 2:18
lainoo31-Jan-05 2:18 
GeneralRe: SQL transactions commit and rollback Pin
DavieB31-Jan-05 4:44
DavieB31-Jan-05 4:44 
GeneralC# dll VBA Excel Addin Pin
mitsemaj30-Jan-05 18:58
mitsemaj30-Jan-05 18:58 
GeneralRe: C# dll VBA Excel Addin Pin
Robert Rohde30-Jan-05 19:06
Robert Rohde30-Jan-05 19:06 
GeneralRe: C# dll VBA Excel Addin Pin
mitsemaj30-Jan-05 19:35
mitsemaj30-Jan-05 19:35 
Questionhow to used unmanaged class library on a C# web application Pin
smallcase30-Jan-05 16:54
smallcase30-Jan-05 16:54 
Generalsending file using UDP error Pin
Sakkijha30-Jan-05 11:16
Sakkijha30-Jan-05 11:16 

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.