String Split function in VB.net
By: Issac
The string split function returns array of strings which are the splits of the given string it is delimited by the given System.Char array
Public Function Split (ByVal ParamArray separator () As Char) As String ()
Parameters:
Separator - the given delimiter
Returns:
An array of Strings delimited by one or more characters in separator
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String
Dim strArr() As String
Dim count As Integer
str = "God is great"
strArr = str.Split(" ")
For count = 0 To strArr.Length - 1
MsgBox(strArr(count))
Next
End Sub
End Class
When you run this code, you will get "God" "is" "great" in separate messagebox.
Archived Comments
1. Good Material
View Tutorial By: Peter at 2013-09-04 23:11:46
2. hello, please i need a help.. i'm trying to make a VB program, the program is a windows form applica
View Tutorial By: Ludmila at 2012-12-10 17:56:00
3. Try this code:
Public Class Form1
Private Sub Button1_Click(ByVal send
View Tutorial By: Eldan at 2012-06-17 08:25:09
4. I have one textbox and three label.i want to parse strings from textbox to these label by comma.How
View Tutorial By: Nara at 2011-08-01 06:16:07
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Using Resume Next and Resume Line in VB.net
Using On Error GoTo 0 in VB.net
Getting an Exception's Number and Description in VB.net
Raising an Exception Intentionally in VB.net
Exception Filtering in the Catch Block in VB.net
Using Multiple Catch Statements in VB.net
Throwing an Exception in VB.net
Throwing a Custom Exception in VB.net
Changes in Controls from VB6 to VB.net
Unstructured Exception Handling in VB.net