this is my code:
    var a='(1,2,3,4)'
    a=a.sl开发者_JS百科ice(-1,1)
    alert(a)
and i print nothing.
thanks
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 ( and ) characters in the string, giving you :
"1,2,3,4"
Another alternative:
var a='(1,2,3,4)';
a.replace(/^\((.*)\)$/, "$1");
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论