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
 Development Tools
 Other Development Tools
 Replace string

Author  Topic 

shajimanjeri
Posting Yak Master

179 Posts

Posted - 2008-03-23 : 10:23:05
Dear All,

I have string.
MyStr = "1111111111"
Note that all my string letters are unique, its 111111111.

here I need to replace the third and seventh letter of this string with 0(zero) by using classical asp. Does anybody have an idea?
All suggestions are highly appreciated.

with regards
Shaji

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2008-03-24 : 00:16:24
[code]
Dim MyStr
MyStr ="1111111111"

Response.Write (MyStr +"<br>")
MyStr = left(MyStr ,2) + Replace(MyStr ,"1","0",3,1)
MyStr = left(MyStr, 6) + Replace(MyStr ,"1","0",7,1)
Response.Write (MyStr +"<br>")

[/code]

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page
   

- Advertisement -