JSStringFormat

Escapes special JavaScript characters, such as single quotation mark, double quotation mark, and newline

Method Signature

JSStringFormat(string=[string])

Arguments

Argument
Type
Required
Description
Default

string

string

true

The string to escape.

Examples

jsStringFormat Example

This example illustrates use of the JSStringFormat function.

Run Example

string = "An example string value with ""quoted"" 'text'";
writeOutput( JSStringFormat( string ) );

Additional Examples

Run Example

str = "Bob's comment was ""BL rocks!""";
writeOutput( str & "<br>" );
writeOutput( JSStringFormat( str ) );

Last updated

Was this helpful?