Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi...
I have One string.
 
00AA015949
 
How to Get After Chartres Value.
For Eg:
 
00AA015949
1)00AA
2)015949
Posted 22-Jan-13 21:28pm
Achal Oza1.6K
Comments
Sergey Alexandrovich Kryukov at 23-Jan-13 2:33am
   
Banned by Google? How about Bing? Both of them? Sorry, be more careful next time, do not search too much. :-)
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You need to see exactly two Microsoft documentation pages:
http://msdn.microsoft.com/en-us/library/system.string.substring.aspx[^],
Microsoft Q209354.
 
—SA
  Permalink  
Comments
Abhinav S at 23-Jan-13 2:34am
   
5!
Sergey Alexandrovich Kryukov at 23-Jan-13 2:37am
   
Thank you, Abhinav.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Regex split functions[^] can give you an opportunity to filter out strings based on type.
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 23-Jan-13 2:37am
   
Of course, depending on the formulation of the problem, which is actually totally missing in this "question". My 5.
—SA
Abhinav S at 23-Jan-13 2:47am
   
Thank you SA.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Dim strText as string="00AA015949"
Dim strText1 as string
Dim strText2 as string
 
strText1 = strText.SubString(0,4) ' 00AA
strText2 = strText.SubString(4) ' 015949
  Permalink  
Comments
Achal Oza at 29-Jan-13 6:59am
   
But Not Fix 00AA015949 this number.
0AA546545 ... How to get..???
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

Is this what you are looking for?
 
Imports System.Text.RegularExpressions
Module Module1
 
  Sub Main
    Dim txt As String ="00AA015949" ' Put value you want to test here!

    Dim re1 As String="(\d+)"	'Integer Number 1
    Dim re2 As String="((?:[a-z][a-z]+))"	'Word 1
    Dim re3 As String="(\d+)"	'Integer Number 2

    Dim r As Regex = new Regex(re1+re2+re3,RegexOptions.IgnoreCase Or _ 
                     RegexOptions.Singleline)
    Dim m As Match = r.Match(txt)
    If (m.Success) Then
        Dim int1=m.Groups(1)
        Dim word1=m.Groups(2)
        Dim int2=m.Groups(3)
        Console.WriteLine("(" & int1.ToString() & _
            ")" & "(" & word1.ToString() & ")" & _
            "(" & int2.ToString() & ")")
    End If
    Console.ReadLine()
  End Sub
End Module
 
I generated this at: txt2re - regular expression generator[^]
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

private sub getstringandnumber()
 
    Dim lstring As String = "00AA015949"
    Dim lstrChar As String
    Dim lstrNum As String
    Dim lblnChar As Boolean
    Dim i As Integer
 
    For i = 1 To Len(lstring)
 
        If IsNumeric(Mid(lstring, i, 1)) Then
            If lblnChar Then
                lstrNum = lstrNum & Mid(lstring, i, 1)
            Else
                lstrChar = lstrChar & Mid(lstring, i, 1)
            End If
        Else
            lstrChar = lstrChar & Mid(lstring, i, 1)
            lblnChar = True
        End If
    Next
 
    MsgBox(lstrChar & "   " & lstrNum)
 
End Sub
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 520
1 Maciej Los 205
2 Suvendu Shekhar Giri 159
3 Peter Leow 140
4 Kornfeld Eliyahu Peter 133
0 Sergey Alexandrovich Kryukov 9,623
1 OriginalGriff 8,895
2 Peter Leow 5,044
3 Kornfeld Eliyahu Peter 3,333
4 Maciej Los 2,561


Advertise | Privacy | Mobile
Web04 | 2.8.150327.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100