Bitrix Site Manager

oBXEditorUtils.PHPParser.trimQuotes

string
oBXEditorUtils.PHPParser.trimQuotes(
 string sCode[,
 string cSym]
);

The oBXEditorUtils.PHPParser.trimQuotes method trims single and double quotes (or other symbols) from the specified string.

Parameters:

Parameter Description
sCode The string which is a PHP code fragment.
cSym Optional string containing symbols to be removed from head and tail of the string. By default, single and double quotes are removed.

Return Values

Returns the string.

Example


<script>

var sCode1 = '"My String"';
sCode1 = oBXEditorUtils.PHPParser.trimQuotes(sCode1);//sCode1 = 'My String';

var sCode2 = "'My String'";
sCode2 = oBXEditorUtils.PHPParser.trimQuotes(sCode2);//sCode2 = "My String";

var sCode3 = '-My String-';
sCode3 = oBXEditorUtils.PHPParser.trimQuotes(sCode3,'-');//sCode3 = 'My String';

</script>
See also trimPHPTags.