- Get link
- X
- Other Apps
C# Split String Example in VB.NET | Split String with Special Characters (comma, underscore etc)
By: Suresh Dasari Mar 13, 2013
Categories: C#.Net, Code Snippets, VB.NET
Introduction:
Here I will explain how to split string in c#, vb.net using asp.net or split string with special characters in c#, vb.net or Split String with Comma, Space in c#, vb.net.
Here I will explain how to split string in c#, vb.net using asp.net or split string with special characters in c#, vb.net or Split String with Comma, Space in c#, vb.net.
Description:
In previous posts I explained Remove last character from string in C#, jQuery Remove first or last characters from string, SQL Server Query to remove first last characters from string, and many articles relating to Asp.net, c#, vb.net, JQuery. Now I will explain how to split string in c#, vb.net using asp.net.
In previous posts I explained Remove last character from string in C#, jQuery Remove first or last characters from string, SQL Server Query to remove first last characters from string, and many articles relating to Asp.net, c#, vb.net, JQuery. Now I will explain how to split string in c#, vb.net using asp.net.
Split String with one character in C#
protected void Page_Load(object sender, EventArgs e)
{
string istr = "Welcome to aspdotnet-suresh.com.";
string []ostr = istr.Split("-".ToCharArray());
foreach (string s in ostr)
{
Response.Write(s+"<br/>");
}
}
|
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim istr As String = "welcome to aspdotnet-suresh.com."
Dim ostr As String() = istr.Split("-".ToCharArray())
For Each s As String In ostr
Response.Write(s & "<br/>")
Next
End Sub
|
Welcome to aspdotnet
suresh.com. |
Split String with multiple characters in C#
protected void Page_Load(object sender, EventArgs e)
{
string istr = "welcome, to, aspdotnet-suresh.com.";
string []ostr = istr.Split(",-.".ToCharArray());
foreach (string s in ostr)
{
Response.Write(s+"<br/>");
}
}
|
Split String with multiple characters in VB.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim istr As String = "welcome, to, aspdotnet-suresh.com."
Dim ostr As String() = istr.Split(",-.".ToCharArray())
For Each s As String In ostr
Response.Write(s & "<br/>")
Next
End Sub
|
welcome
to aspdotnet suresh com |
Comments
Post a Comment