String split multiple characters
string-split-multiple-characters.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
<!DOCTYPE html>
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
string text = "Black Maple+Creek Maple+Cutleaf Maple+River Maple";
Label1.Text = text;
//this line string split by multiple characters
string[] stringSplittedArray = text.Split(new string[] { "Maple+" }, StringSplitOptions.None);
Label1.Text += "<br /><br />splitted string by multiple characters ['Maple+']......<br />";
foreach (string s in stringSplittedArray)
{
Label1.Text += s + "<br />" ;
}
Label1.Text += "<br />look carefully last Maple not splitted because it has no plus......<br />";
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>c# example - string split multiple characters</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
c# example - string split multiple characters
</h2>
<hr width="550" align="left" color="Gainsboro" />
<br />
<asp:Label
ID="Label1"
runat="server"
Font-Size="Large"
>
</asp:Label>
<br /><br />
<asp:Button
ID="Button1"
runat="server"
Text="string split multiple characters"
OnClick="Button1_Click"
Height="40"
Font-Bold="true"
/>
</div>
</form>
</body>
</html>

- How to repeat a string
- How to split a string
- How to split a string by another string
- How to check whether a string contains at least one number
- How to check whether a string contains numbers only
- String contains list of strings
- How to add backslash to a string
- How to concatenate multiple strings
- String endswith ignorecase
- How to check whether a string ends with a number