Removing excess white space

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 

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

Back
Top