please dont rip this site
JScript  

slice Method (String)

Returns a section of a string.

stringObj.slice(start, [end]) 

Arguments

stringObj
Required. A String object or literal.
start
Required. The index to the beginning of the specified portion of stringObj.
end
Optional. The index to the end of the specified portion of stringObj.

Remarks

The slice method returns a String object containing the specified portion of stringObj.

The slice method copies up to, but not including, the element indicated by end. If start is negative, it is treated as length + start where length is the length of the string. If end is negative, it is treated as length + end where length is the length of the string. If end is omitted, extraction continues to the end of stringObj. If end occurs before start, no characters are copied to the new string.

Example

In the following example, the two uses of the slice method return the same result. In the second example, negative one (-1) points to the last character in str1 as the ending point.

str1.slice(0)
str2.slice(0,-1)

Requirements

Version 3

See Also

Array Object | slice Method (Array) | String Object Methods

Applies To: String Object

 Contact Us   |  E-Mail this Page   |  MSDN Flash Newsletter
 © 2002 Microsoft Corporation. All rights reserved.   Terms of Use  Privacy Statement   Accessibility

file: /Techref/language/asp/js/slice.htm, 5KB, , updated: 2003/8/9 08:06, local time: 2024/12/18 23:42, owner: JMN-EFP-786,
TOP NEW HELP FIND: 
18.191.147.141: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?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.org/techref/language/asp/js/slice.htm"> slice</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .