Microsoft® JScript substring Method |
Language Reference Version 1 |
Retrieves the substring at the specified location within a String object.
strVariable.substring(start, end)
"String Literal".substring(start, end)The substring method syntax has these arguments:
Part Description start The zero-based index indicating the beginning of the substring. end The zero-based index indicating the end of the substring.
The substring method returns a String object containing the substring derived from the original object.The substring method uses the lower of start and end as the beginning point of the substring. For example, strvar.substring(0, 3) and strvar.substring(3, 0) return the same substring.
The only exception to this is for negative parameters. If the first parameter is less than zero, it is treated as zero. If the second parameter is negative, it is set to the value of the first parameter.
The length of the substring is equal to the absolute value of the difference between start and end. For example, the length of the substring returned in strvar.substring(0, 3) and strvar.substring(3, 0) is three.
Finally, start and end can be strings. If so, these strings are coerced into integers if possible. If not, the value of the parameter is treated as zero.
© 1997 by Microsoft Corporation. All rights reserved.
file: /Techref/language/jscript/js851.htm, 3KB, , updated: 1997/9/30 03:45, local time: 2024/8/22 03:25,
18.219.176.162:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/tecHREF/language/jscript/js851.htm"> substring Method</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.