<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>string对象</title> <script type="text/javascript"> var mystr="Hello World!" document.write( mystr.substring(6) + "<br />"); document.write( mystr.substring(0,6) ); </script> </head> <body> </body> </html>
空格也是一个字符,我发现但提取Hello时,右有空格,那么请问mystr.substring(0,6)和mystr.substring(0,5)有什么区别?
有什么规定的吗?
mingsixue
蜂之谷