Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

removeing spaces from a string

0 views
Skip to first unread message

Brian Henry

unread,
Jun 1, 2003, 5:20:19 PM6/1/03
to
does anyone know of any code to remove spaces from a string? and not just
put nulls in place. if i have a string and go char by char through it as an
array and replace a space with "" it just places /0 nulls in the place.
anyone know how to move the next good character in its place? (basicly
removeing spaces in a string) so something like

A DH DJS
would be
ADHDJS

Thanks!


Steve C. Orr, MCSD

unread,
Jun 1, 2003, 7:11:49 PM6/1/03
to
Try this:

MyString.Replace(" ", String.Empty)

Here's more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemStringClassReplaceTopic2.asp

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


"Brian Henry" <bria...@adelphia.net> wrote in message
news:uhVbbOIK...@TK2MSFTNGP11.phx.gbl...

0 new messages