Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
AnswerRe: e of godgames Pin
LongRange.Shooter23-Oct-06 4:36
LongRange.Shooter23-Oct-06 4:36 
Questiondouble buffering in child controls Pin
ssoffline20-Oct-06 21:05
ssoffline20-Oct-06 21:05 
Questionrecord sound Pin
rzvme20-Oct-06 20:25
rzvme20-Oct-06 20:25 
AnswerRe: record sound Pin
mav.northwind20-Oct-06 21:07
mav.northwind20-Oct-06 21:07 
QuestionTransparency with Windows buttons without flicker Pin
Andreas8820-Oct-06 13:57
Andreas8820-Oct-06 13:57 
QuestionHow to replace multiple spaces in a string to single space. Pin
jerry_pendergraft20-Oct-06 11:58
jerry_pendergraft20-Oct-06 11:58 
AnswerRe: How to replace multiple spaces in a string to single space. Pin
Guffa20-Oct-06 12:09
Guffa20-Oct-06 12:09 
GeneralRe: How to replace multiple spaces in a string to single space. Pin
jerry_pendergraft23-Oct-06 11:00
jerry_pendergraft23-Oct-06 11:00 
Thanks alot Big Grin | :-D That was a huge help. This is how I used it.

str1 = "    spaces     morespaces    ";
str2= Regex.Replace(str1," {2,}", " ");

I noticed that it replaced every occurence of a mulitple space with a single space even at the beginning and the end. So I used:

str2 = Regex.Replace(str2,@"^\s*(.*?)\s*$", "$1");

to trim all of the leading and trailing spaces

Result:
"spaces morespaces"


GeneralRe: How to replace multiple spaces in a string to single space. Pin
Dustin Metzgar23-Oct-06 11:18
Dustin Metzgar23-Oct-06 11:18 
QuestionCancelling current printing job from printer spool Pin
pnpfriend20-Oct-06 11:32
pnpfriend20-Oct-06 11:32 
QuestionShuffling elements in a control array... [modified] Pin
new_phoenix20-Oct-06 11:06
new_phoenix20-Oct-06 11:06 
AnswerRe: Shuffling elements in a control array... Pin
Stefan Troschuetz20-Oct-06 22:13
Stefan Troschuetz20-Oct-06 22:13 
QuestionRe: Here is a little compounding issue... Pin
new_phoenix21-Oct-06 4:36
new_phoenix21-Oct-06 4:36 
AnswerRe: Here is a little compounding issue... Pin
Stefan Troschuetz22-Oct-06 0:49
Stefan Troschuetz22-Oct-06 0:49 
Questioncontrol visible property????? Pin
Small Rat20-Oct-06 8:57
Small Rat20-Oct-06 8:57 
QuestionManipulating MP3 files Pin
Ross Petersen20-Oct-06 8:55
Ross Petersen20-Oct-06 8:55 
AnswerRe: Manipulating MP3 files Pin
David Knechtges20-Oct-06 9:20
David Knechtges20-Oct-06 9:20 
QuestionRandom Number Generator Pin
Belfast Child20-Oct-06 8:33
Belfast Child20-Oct-06 8:33 
AnswerRe: Random Number Generator Pin
eggsovereasy20-Oct-06 8:42
eggsovereasy20-Oct-06 8:42 
GeneralRe: Random Number Generator Pin
Belfast Child20-Oct-06 9:28
Belfast Child20-Oct-06 9:28 
GeneralRe: Random Number Generator Pin
Wjousts20-Oct-06 9:33
Wjousts20-Oct-06 9:33 
GeneralRe: Random Number Generator Pin
Belfast Child20-Oct-06 10:00
Belfast Child20-Oct-06 10:00 
GeneralRe: Random Number Generator Pin
Stefan Troschuetz20-Oct-06 21:54
Stefan Troschuetz20-Oct-06 21:54 
GeneralRe: Random Number Generator Pin
User 665820-Oct-06 9:49
User 665820-Oct-06 9:49 
GeneralRe: Random Number Generator Pin
Guffa20-Oct-06 12:14
Guffa20-Oct-06 12:14 

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.