Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
renu
Starting Member
47 Posts |
Posted - 2008-04-01 : 01:14:15
|
i have to remove white spaceeg>select LTRIM[RE ]I SHOULD GET THE OUTPUT LIKE [RE]How can i achieve that |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-04-01 : 01:54:41
|
I wasn't sure whether the [] were included ,if so then it's the first select declare @var varchar(20)SET @var = '[RE ]'select replace(@var,' ','')select ltrim(rtrim(@var))Jack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-04-02 : 02:53:45
|
quote: Originally posted by jackv I wasn't sure whether the [] were included ,if so then it's the first select declare @var varchar(20)SET @var = '[RE ]'select replace(@var,' ','')select ltrim(rtrim(@var))Jack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com
Replace would do ltrim and rtrim also MadhivananFailing to plan is Planning to fail |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-04-02 : 06:11:29
|
I think Jack gave two different solutions, one when output includes square brackets and another one to trim trailing spaces when output does not include brackets.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|