----Asp.net detailed usage of the split function -----

Source: Internet
Author: User
The split function can be used in ASP and Asp.net to process strings conveniently.

The split function returns a zero-dimensional array containing a specified number of substrings.
Syntax
Split (expression [, delimiter [, Count [, start])
The syntax of the split function includes the following parameters:
Parameter description
Expression is required. A string expression that contains a substring and a separator. If expression is a zero-length string, split returns an empty array, that is, an array that does not contain elements and data.
Delimiter is optional. Character used to identify the substring boundary. If omitted, use space ("") as the separator. If Delimiter is a zero-length string, a single element array containing the entire expression string is returned.
Count is optional. Number of substrings to be returned.-1 indicates that all substrings are returned.
Compare is optional. Indicates the value of the comparison type used to calculate the substring. For values, see the "Settings" section.
Set
The compare parameter can have the following values:
Constant Value description
Vbbinarycompare 0 performs binary comparison.
Vbtextcompare 1 performs text comparison.
Description
The following example uses the split function to return an array from a string. The function compares the delimiters and returns all substrings.
ASP

Dim mystring, myarray
Mystring = Split ("vbscriptxisxfun! "," X ",-1, 1)
'Mystring (0) contains "VBScript ".
'Mystring (1) contains "is ".
'Mystring (2) contains "fun! ".

Asp.net


String TMP = "SD, SSDS ";
String [] Mm = TMP. Split (',');

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.