trimQuotes
string oBXEditorUtils.PHPParser.trimQuotes( string sCode[, string cSym] );
The 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. |
Returned 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.
© «Bitrix24», 2001-2024