remove space

G

Georg

hi,

how can i in ado.net remove all spaces in a name eg "S P A C E" must be
showed as "SPACE" . with a trim function ?

regards Georg
 
S

Scott M.

Georg said:
hi,

how can i in ado.net remove all spaces in a name eg "S P A C E" must
be showed as "SPACE" . with a trim function ?

regards Georg

ADO .NET has nothing to do with modifying a string value. ADO .NET is
simply the part of the .NET Framework Base Class Library that provides
classes for data access via providers like SQL, ODBC, OleDB, etc.

What you need is simply to utilize the String object's methods in whichever
..NET language you are using:

[VB .NET]
Dim startString As String = "S P A C E"
Dim resultString As String = startString.Replace(" ", "")

[C#]
String startString = "S P A C E";
String resultString = startString.Replace(" ", "");

-Scott
 
G

Georg

Scott M. said:
Georg said:
hi,

how can i in ado.net remove all spaces in a name eg "S P A C E" must
be showed as "SPACE" . with a trim function ?

regards Georg

ADO .NET has nothing to do with modifying a string value. ADO .NET is
simply the part of the .NET Framework Base Class Library that provides
classes for data access via providers like SQL, ODBC, OleDB, etc.

What you need is simply to utilize the String object's methods in
whichever .NET language you are using:

[VB .NET]
Dim startString As String = "S P A C E"
Dim resultString As String = startString.Replace(" ", "")

[C#]
String startString = "S P A C E";
String resultString = startString.Replace(" ", "");

-Scott
Hi Scott,
it works with replace in Vb.net

thnx, Georg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top