Jump to content
  • Advertisement
Sign in to follow this  
phil05

What is VB.NET's newline keyword?

This topic is 4908 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Actually, if you want C style escape characters:

'simple iterative string processor to convert C style escape sequences (written by Promit Roy)
Public Function EscapeString( Text As String ) As String
Dim Res As String
Dim Arr As Char()
Dim i As Integer

Arr = Text.ToCharArray()

i = 0
Do While i < Arr.Length()
If Arr(i) = "\" Then
'process it
i += 1
Select Case Arr(i)
Case "t"
Res += vbTab
Case "r"
Res += vbCr
Case "n"
Res += vbLf
Case "v"
Res += vbVerticalTab
Case "f"
Res += vbFormFeed
Case "'"
Res += "'"
Case """" 'double quote
Res += """"
Case "b"
Res += vbBack
Case "0"
Res += vbNullChar
Case "a"
Res += Chr( &H7 )
Case "\"
Res += "\"
Case Else
'don't do anything with res
End Select
Else
Res += Arr(i)
End If

i += 1
Loop

Return Res
End Function




It's not nearly as powerful as the actual C escape sequences, but provides most of the common escape characters.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!