Click to See Complete Forum and Search --> : removing characters from a string
DBoy
October 16th, 2001, 02:43 AM
I am a VB novice so any help would be appreciated!
I need to search through a string and replace any carriage returns, commas and line feeds with spaces. How can I do this?
Thanks
srinika
October 16th, 2001, 03:01 AM
get the help on following using MSDN & try it urself
- Mid() , Instr() , Replace() , Chr() , Asc() ....
Cimperiali
October 16th, 2001, 03:21 AM
Shrinka is right, but for a quick solution:
mystring= replace(mystring,vbcrlf, "")
mystring= replace(mystring,",", "")
mystring= replace(mystring,chr(13) & " ", "")
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Cimperiali
October 16th, 2001, 03:22 AM
I mispelled your nickname. Sorry...
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
Green_Beret
October 16th, 2001, 03:23 AM
dim str as string
str = "This is a s,tring with some tabs,commas
and one carriage return"
str = Replace(str,","," ")
str = Replace(str,vbCrLf," ")
str = Replace(str,vbTab," ")
O/P :"This is a s tring with some tabs commas and one carriage return"
Green_Beret
October 16th, 2001, 03:24 AM
No longer!
srinika
October 16th, 2001, 06:32 AM
with regard to mis-spell - that's alright!!!
That's not my Nick Name but the Name
i couldn't reply in detail as I was busy at that time
Have a nice Day
Srinika
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.