whats the equivalent of vbcrlf,vbcr,vblf (vbscript) in c#.net

  • Thread starter Thread starter sundar_s1210
  • Start date Start date
S

sundar_s1210

i have the following code in asp using vbscript

replace(str,vbcrlf," ")
replace(str,vbcr," ")
replace(str,vblf," ")

where str is any string

i want to convert this code in asp.net using c#.ne


-
sundar_s121
 
I think what you are looking for is \n
Not sure if C# has as many variants as VB. I think \n is the only one.

Shawn
 
See Manohar's reply.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================

Shawn said:
I think what you are looking for is \n
Not sure if C# has as many variants as VB. I think \n is the only one.

Shawn
 
Assuming you're actually using the new strings returned, here's the
equivalent from our Instant C# VB.NET to C# converter:

newstring = str.Replace("\r\n", " ");
newstring = str.Replace("\r", " ");
newstring = str.Replace("\n", " ");

The first line could also be:
newstring = str.Replace(System.Environment.NewLine, " ");
(our converter has an option to use this more system-independent version)

David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter
and the Instant VB C# to VB.NET converter
 
Back
Top