this is my code:
var a='(1,2,3,4)' a=a.slice(-1,1) alert(a)
and I’m not printing anything.
thank
I think you want to do:
a = a.slice(1, -1);
a.substring(1,a.length-1) 1,2,3,4
What about:
'(1,2,3,4)'.replace(/[()]/g, '')
Which will remove all (s) of the characters in the string, giving you:
"1,2,3,4"
Another alternative:
var a='(1,2,3,4)'; a.replace(/^\((.*)\)$/, "$1");
Source: https://habr.com/ru/post/1739830/More articles:Get function name from DLL - functionA pdf download option should appear - javascriptwe can add system icons to flex application - flexecho problem in audio / video chat application - echoSingle Regex to filter Roman numerals from text files - regexТребуется руководство по архитектуре? - c#I am looking for the actual functional web browser control for .NET, possibly the C ++ library - c ++Installer for web application - javaJQuery plugin for html5 ads for videos? - jqueryWhat is the mysql equivalent of Sql Server @@ Identity and @@ errors and how to use try catch in mysql - sqlAll Articles