vb.net - Getting the character that inside the brackets -


this string:

dim value string = "ir_10748(1).jpg" 

how can number 1 variable? thinking use split. how can use value in vb.net?

try this:

dim value string = "ir_10748(1).jpg" dim splitstrings() string  'split on either opening or closing parenthesis -  'this give 3 strings - "ir_10748","1",".jpg" splitstrings = value.split(new string() {"(",")"}, stringsplitoptions.none)  'parse integer if required dim integer = integer.parse(splitstrings(1)) 

demo


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -