i have a string containing value like this
i ={11212}
{22121}
{3113}
{4122}
{5121}
......
......
How can i count the total no of value ?
You can use LinQ to count the number of brackets:
Dim Count = (From s In i Select s Where s = "{").Count
And you should rename i to something sensible in my opinion.
For when you have just any delimiter in your text and want to count single numbers you can as well use a regular expression and count the matches:
Dim InputString = "{11212}{22121}{4122}12312"
Dim rx As New System.Text.RegularExpressions.Regex("[0-9]+")
Dim NumberCount = rx.Matches(InputString).Count 'Outputs 4
This searches for occurences of numbers of any length in your input.
listBox.Items.Count?