How can I split a string into two separate arrays using the .NET framework? -
I have a string that has both ints and a string. How do I split it into two arrays, one for ints and one string? I also need to maintain the system because I am writing a file parsing system that depends on reading and dividing these stars correctly.
Edit: Here is a sample input, and what would I like as an output:
~ Wolf 100 45 4 5
EDIT: A bit more information:
I am getting five variables from the user and writing them in the file again, I am reading them again. I should be able to identify the number of names. Now when I think about it, in fact, I'm not sure that dividing the string is the best way. Is there a way to put both ints and strings in the same array? In this way I can get the name, and know that it is related to the next four inches.
with a string
as a key , Use of TVL) , and a value as a integer ()
array. This will give you the functionality of the lookup which you are seeing ...
sub-main () slow input string = "~ Wolf 100 45 4 5" & amp; environment. November & amp; _ "~ Rakun 500 4197" string as input in the form of a new dictionary (string, integer ()) for each line as Dame Dict Split (environment new line) Dim key such as integer () = integer (integer)) {} in line as a string for each line. Split ("" c) Dim TryInt as integer if integer. Try the tray purse (line value, triangle) then keep the redeem values safe (say length) value (value length = 1) = TryInt Else key = line val If the rim ("~") does not end the next string. IISNullOrEmpty (Key) Then Dict.Add (key, value) end if 'How to use \\' Dim as WolfVals Integer () = Dict.Item ("Wolf") as integer in the WolfVills console as each int for. Wrightite (next) Next console. Read () End Sub
Comments
Post a Comment