EscapeString()

Syntax

Result$ = EscapeString(String$ [, Mode])
Description
Returns the escaped version of the string. UnescapeString()() can be used to do the reverse operation.

Parameters

String$ The string to escape.
Mode (optional) The mode to use when escaping the string.
  #PB_String_EscapeInternal: escape the string using PureBasic internal format (see General rules
                             for accepted escape sequences) (default).
  #PB_String_EscapeXML     : escape the string using the XML escape characters. This can be useful to easily put any string in a
                             XML tree.

Return value

An escaped string.

Example

  Debug EscapeString("Test="+Chr(34)+"Hello"+Chr(34)+".") ; Will display "Test=\"Hello\"."
  Debug EscapeString("<item>Hello</item>", #PB_String_EscapeXML) ; Will display "&lt;item&gt;Hello&lt;/item&gt;"

See Also

UnescapeString()

Supported OS

All

<- CountString() - String Index - FindString() ->