G gz7tnn Member Licensed User Longtime User Dec 16, 2014 #1 I am unable to find anything that helps me here. What I want to do is split a string into separate components, where the separator is (eg) ';' The original string will have 3 segments, however one of those will contain at least 2 or more words. Example 1> N172635;Long Handled Hammer;1234 Example 2> Misc999;short stubby hammer with steel handle;989h6 I have looked at regex but as the middle segment of the input string will differ each time I have been unable to create a matching pattern via that method. Any suggestions as to how I can extract the 3 separate components would be appreciated.
I am unable to find anything that helps me here. What I want to do is split a string into separate components, where the separator is (eg) ';' The original string will have 3 segments, however one of those will contain at least 2 or more words. Example 1> N172635;Long Handled Hammer;1234 Example 2> Misc999;short stubby hammer with steel handle;989h6 I have looked at regex but as the middle segment of the input string will differ each time I have been unable to create a matching pattern via that method. Any suggestions as to how I can extract the 3 separate components would be appreciated.
E Eumel Active Member Licensed User Longtime User Dec 16, 2014 #2 With Regex.Split it works.. Which error you get ? B4X: Expand Collapse Copy Dim mystring As String = "N172635;Long Handled Hammer;1234" For Each mystrings As String In Regex.split(";",mystring) Log(mystrings) Next Upvote 0
With Regex.Split it works.. Which error you get ? B4X: Expand Collapse Copy Dim mystring As String = "N172635;Long Handled Hammer;1234" For Each mystrings As String In Regex.split(";",mystring) Log(mystrings) Next
G gz7tnn Member Licensed User Longtime User Dec 16, 2014 #3 Just what I needed. My approach only retrieved the word just before each of the ';' Much appreciated Upvote 0