You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am struggling to find a solution to parse tokens into several different arrays/lists.
The string to tokenize/parse looks like this
(x:x1, x:x2, x:x3, y:y1, z:z1, z:z2)
The result should be stored in a node like this:
class Node
{
List<string> xItems; // contains all items for token x: (x1, x2, x3 in the example above)
List<string> yItems; // contains all items for token y: (y1 in the example above)
List<string> zItems; // contains all items for token z: (z1, z2 in the example above)
}
, or more generically, in a node like this
class MoreGenericNode
{
Dictionary<string,List<string>> items; //the dictionary key is the token (x:, y:, z:, ...)
}
The defined tokens are x:, y:, z:, as well as the comma and the left/right brackets.
Is it possible to get the result information by parsing the input string only once, or is it necessary to parse the string several times, for each token?
The text was updated successfully, but these errors were encountered:
abrasat
changed the title
Oarse tokens into several arrays/lists
Parse tokens into several arrays/lists
Aug 7, 2019
Hi! Sorry about the slow response. I hope you were able to find a solution - otherwise, Stack Overflow would be a great place to get more info on this.
I am struggling to find a solution to parse tokens into several different arrays/lists.
The string to tokenize/parse looks like this
The result should be stored in a node like this:
, or more generically, in a node like this
The defined tokens are x:, y:, z:, as well as the comma and the left/right brackets.
Is it possible to get the result information by parsing the input string only once, or is it necessary to parse the string several times, for each token?
The text was updated successfully, but these errors were encountered: