和java差不多的! javascript的字符串类型也有substring这个函数的!
例如 "abc".substring(...) 去google查一下就有很多这样的例子了
例如 "abc".substring(...) 去google查一下就有很多这样的例子了
解决方案 »
- 问个java文件复制时候的小问题
- 我在struts2的struts.xml中将class制定为spring配置文件中的id名,但是启动tomcat说找不到,不知道有是什么地方该注意的,谢谢
- 网站服务器与数据库要求?
- javascript可以直接调用struts中的action类吗
- J2EE中 苦恼很久的问题!
- 求助,在solaris下安装tomcat的一个问题~~
- 大家帮忙看一看,Tomcat远程访问mysql的问题在线等,本人刚来论坛分嫌少的以后补,谢了
- 各位看过struts1.1自带例子的请进来看看!(问题解决就结贴)
- 为什么eclipse启动时说找不到JDK?怎么解决?
- 404找不到/UserManager/LoginClServlet.java
- struts的分頁問題?
- 大家看一下,这种数据结构怎么做显示?
的很象.所以我们学JAVA的学javascript还是比较简单的
Returns: String of characters between index values indexA and indexB.The string.substring() method enables your scripts to extract a copy of a
contiguous range of characters from any string. The parameters to this method are
the starting and ending index values (first character of the string object is index
value 0) of the main string from which the excerpt should be taken. An important
item to note is that the excerpt goes up to, but does not include, the character
pointed to by the higher index value.
It makes no difference which index value in the parameters is larger than the
other: The method starts the excerpt from the lowest value and continues to (but
does not include) the highest value. If both index values are the same, the method
returns an empty string; and if you omit the second parameter, the end of the
string is assumed to be the endpoint.例:
var aStr = "this is a book";
var bStr = aStr.substring(0, 4);bStr的值为"this"