Asp.net remove deletes string slices at the specified position in the string.

Source: Internet
Author: User
The code is as follows: Copy code


String str = "0123456789 ";
Console. WriteLine (str. Remove (5 ));
Console. WriteLine (str. Remove (5, 1 ));

Instance

Remove ()
Deletes a specified number of characters from a specified position.

The code is as follows: Copy code
<%
String str1 = "I am one of the fans of Transformers ";
Response. Write (str1.Remove (6, 4); // The result is "I am one of Transformers"
%>


Use remove to remove a project from array. The Project Index is automatically reduced by 1.

In Firefox, if the item parameter is set to undefined when you call remove, the first project with the undefined value is removed. In other browsers, the item parameter with the undefined value has no effect.

The following example shows how to use remove.

JavaScript

The code is as follows: Copy code
Var a = ['A', 'B', 'C', 'D', 'E'];
Array. remove (a, 'C ');
// Return result: "a, B, d, e"
Document. write (a, "</p> ");
Array. removeAt (a, 2 );
// Return result // View the results: "a, B, e"
Document. write (a, "</p> ");
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.