In asp.net c #, String. Split has six overload methods. The following is an example. If you need it, you can refer to it.
Below we use some examples to illustrate how to use (the following string words = "1, 2.3, 4 ";):
Split (Char ())? Invalid
SyntaxSplit (expression [, delimiter [, count [, start])The syntax of the Split function includes the following parameters:Expression is required. A string expression that contains a substring and a separator. If expression is a zero-length string,
The strstr () command is to find the address of the first occurrence of the specified string in the original string, which enables the segmentation of the character and the ability to determine if the inclusion is possible:The following example is
One, using a temporary table as an array
Copy Code code as follows:
Create function F_split (@c varchar), @split varchar (2))
Returns @t table (col varchar (20))
As
Begin
while (CHARINDEX (@split, @c) <>0)
Begin
function | string T-SQL is less capable of handling strings, such as I'm looping through strings like 1,2,3,4,5, and if you use arrays, traversal is simple, but T-SQL does not support arrays, so it's tricky to handle. The function below implements
The function below implements the processing of strings like an array.
one, using a temporary table as an array
Copy Code code as follows:
Create function F_split (@c varchar), @split varchar (2))
Returns @t table (col varchar (
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.