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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Replace

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-12 : 08:14:05
mhoque@b2comm.com writes "How can I use the "replace" function to replace more than one char from a sentence. For example, if I wanted to replace "+" and "$" from a string ($12+3) with "X", then how would I write the "replace" function?

If it were one char, then I would have done something like:

string.replace("+", "X")

But, how could I replace both "+" and "$" at the same time? Anyway thought?

Thanks a lot,
Mohammed"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-12 : 08:48:02
Relace(Replace(string,'+','X'),'$','X')

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -