vb.net - splitting a string into multiple variables -


I'm trying to split a string into several variables into the data in my string of spaces There is separate data from a different (random) number.

  "Mike Smith 123 23 33 2 1" I've tried string.split method though I'm having trouble handling numerical data . String dim strFirstName, as strLastName, str_devil intAvg, intHcp, intTotalPins, intGamesTracked as integer strUserInfo = lstUsers.SelectedItem string strider (), as the slow strUserInfo. Strarr = strUserInfo.Split ("." C) as strings strFirstName = strarr (0) strLastName = strarr (1)    

If you do not know how many locations are between each section, you would want to use this surcharge, such as:

  strarr = strUserInfo.split ( New Variable () {""}, String Split Option. RemoveEmptyEntries)   

And when you want to store in a integer variable, ):

  strFirstName = strarr (0) strLastN intevg = CIn (strarr (2)) intHcp = CInt (strarr (3)) intTotalPins = CInt (strarr (4)) intGamesTracked = CInt (strarr (5))    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -