Home Cooker Classes Others Rice CookerGX
Classes  >  encoder  >  JavaScriptStringEncode(string,bool)
encoder class : JavaScriptStringEncode(string,bool) method

Description

Encodes a string.

Syntax

encoderInstance.JavaScriptStringEncode(string targetString, bool addDoubleQuotes)

Arguments

ClassNameDescription
stringtargetStringA string to encode.
booladdDoubleQuotesA value that indicates whether double quotation marks will be included around the encoded string.

Return value

ClassDescription
stringAn encoded string.

Sample code

//anyEncoder is an instance of the encoder type.

//jsString is a javascript code.

string encoded = anyEncoder.HtmlEncode(jsString, true);

Notes

It's a wrapper of the System.Web.HttpUtility.JavaScriptStringEncode(String,Bool).

Links for reference

Copyright © Rice All rights reserved.