.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Collections >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Splitting Functionalities

Posted By:Athira Sreejith       Posted Date: February 22, 2009    Points: 5    Category: Collections    URL: http://www.dotnetspark.com  
 

Splitting Functionalities in Vb.NET  some sample code to do so

Dim fileTestname As String = "General(10-11-2006(335)).xml"

Dim userid As String = getuserId(fileTestname)

SaveAnswer(questionid, userid)

 

 

Private Function getuserId(ByVal filename As String)

Dim value As String = filename

Dim sites As String() = Nothing

Dim sep(5) As Char

sep(0) = """"

sep(1) = "("

sep(2) = "-"

sep(3) = ")"

'sep(4) = "]"

'sep(5) = """"

Dim x, y, z As String

Dim x1, x2 As Integer

x1 = 1

sites = value.Split(sep, 6)

Dim s1, s2 As String

For Each s1 In sites

If x1 = 2 Then

x = s1

'MsgBox(x)

End If

If x1 = 5 Then

y = s1

'MsgBox(y)

End If

x1 += 1

'MsgBox(s1)

Next

Return y

End Function



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend