How to get the values from {}
hello Genius
how to get the values from "{}" as List(of string)
Code:
Private _data$ = "frameshape{r90}{r-10}{aAzZ}{textlayer}"
i mean want to split this values like below
Dim getdatas As New List(Of String)
getdatas(0) = "r90"
getdatas(1) = "r-10"
'''''
can anybody help me
Thanks...........
Re: How to get the values from {}
You could probably use a Regex as well but String.Split is an easy enough option.
Code:
Dim data = "frameshape{r90}{r-10}{aAzZ}{textlayer}"
Dim arr = data.Split({"{"c, "}"c}, StringSplitOptions.RemoveEmptyEntries)
For Each elem In arr
MessageBox.Show(elem)
Next
Note that that will include the "frameshape" too but you can easily enough ignore that.
Re: How to get the values from {}
Answer: This seems like a C/C++/C#, type of command syntax!!
Question: Can I ask why are you working with C command syntaxus, in VB.NET???
Re: How to get the values from {}
here's how with regex:
vb Code:
Imports System.Text.RegularExpressions
Public Class Form1
Private _data$ = "frameshape{r90}{r-10}{aAzZ}{textlayer}"
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim getdatas As List(Of String) = New Regex("\{(.+?)\}").Matches(_data$).Cast(Of Match).Select(Function(m) m.Groups(1).Value).ToList
End Sub
End Class
Re: How to get the values from {}
wow...!!! thanks ...it's working fine sir........
JMC,Paul thanks for your great codes thank you so much.....
Quote:
Can I ask why are you working with C command syntaxus, in VB.NET???
this is not c,c++ codes ...m getting this values from com component and then react for this values
sorry for late because of long vacations
Re: How to get the values from {}
oops i can't rate your posts WHY ....???? JMC n Paul........