Removing excess white space

G

Guest

I am building up the validation expression for a RegularExpresionValidator
control by retreiving some values from a database and looping through the
DataTable to build and adding lots of | characters. Basically i want to
build up a string along the lines of ^102|103|104|105$ where the number are
coming from the data table. This is easy enough and works fine.
Unfortunately the data values from the database are padded out with loads of
spaces at the end which builds a string like ^102 |103 |104
|104 |$ which doesn't seem to work for the validation expression.
How do i remove the extraneus white space from the end of data before adding
it to the string variable. Bearing in mind that the data in the database is
not always the same length.
 
G

Guest

Unfortunately TRIM doesn't apear to be a TSQL function. At least it doesn't
work with SQL 2000, it just returns a "no such funtion as TRIM exception.
 
Joined
Feb 3, 2011
Messages
1
Reaction score
0
Solution in SQL

Go take a look at sqltrim[dot]codeplex[dot]com for a sql solution to removing whitespaces
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top