Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove line breaks from a string

Status
Not open for further replies.

AntunB

IS-IT--Management
Aug 11, 2003
263
AU
ok if i hav a string with 2 breaks at the end "vbcrlf"

how would i remove em???????

text1
text2
text3
text4
.
.

. being the spaces


thanks
 
not sure if this is what you are looking for, but:
you can concatinate them like this
str1 = "hi"
str2 = "bye"
str3 = "hello"
str4 = "goodbye"
wscript.echo str1+str2+str3+str4
output
hibuyhellogoodby

or you can replace chr(10) and chr(13). 10 and 13 are carriage returns.
 
nah

strtext = "text1
text2
text3
text4


"

now i want to remove the breaks with nuthing on the line so it would be

strtext = "text1
text2
text3
text4"

tnx for your help newayz
 
Something like this ?
Code:
While Right(strText,1)=vbCrLf
  strText=Left(strText,Len(strText)-1)
Wend

Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top