Use Regx.split to split string : Regular Expressions « Network Remote « VB.Net

VB.Net
1. 2D
2. Application
3. Class
4. Data Structure
5. Database ADO.net
6. Development
7. Event
8. File Directory
9. Generics
10. GUI
11. Language Basics
12. Network Remote
13. Thread
14. Windows System
15. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VB.Net » Network Remote » Regular ExpressionsScreenshots 
Use Regx.split to split string
Use Regx.split to split string

Imports System
Imports System.Text
Imports System.Text.RegularExpressions


Public Class MainClass
    
    Shared Sub Main()
             Dim s1 As String = "One,Two,Three"
             Dim sBuilder As New StringBuilder(  )
             Dim id As Integer = 1

             Dim subString As String
             For Each subString In Regex.Split(s1, " |, |,")
                 id = id + 1
                 sBuilder.AppendFormat("{0}: {1}" _
                   & Environment.NewLine, id, subString)
             Next subString
             Console.WriteLine("{0}", sBuilder.ToString(  ))
           
   End Sub

End Class


           
       
Related examples in the same category
1. Use Regular Expression to Validate Email addressUse Regular Expression to Validate Email address
2. Validate TextBox: cannot be empty
3. TextBox validation: validate in KeyPressed EventTextBox validation: validate in KeyPressed Event
4. Use Regular Expressions to parse IP address
5. Use Regex to separate stringsUse Regex to separate strings
6. Use Regex to matchUse Regex to match
7. Regular to parse time: 04:03:27Regular to parse time: 04:03:27
8. Regular Expressions MatchRegular Expressions Match
9. Use Regular Expressions to Split StringUse Regular Expressions to Split String
10. Demonstrating Class Regex
11. Regular Expressions: Validate NameRegular Expressions: Validate Name
12. Regular Expressions: Validate AddressRegular Expressions: Validate Address
13. Regular Expressions: Validate City
14. Regular Expressions: Validate Zip CodeRegular Expressions: Validate Zip Code
15. Regular Expressions: validate Phone Number
16. Using Regex method Replace: ^Using Regex method Replace: ^
17. Using Regex method Replace: by another stringUsing Regex method Replace: by another string
18. Using Regex method Replace:\w+Using Regex method Replace:\w+
19. Using Regex method Replace:First 3 digits replacedUsing Regex method Replace:First 3 digits replaced
20. Using Regex method Replace: String split at commasUsing Regex method Replace: String split at commas
www___.j__ava__2s___.c_o__m__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.