Home > Back-end >  how can I use Split Method to parse this set of numbers?
how can I use Split Method to parse this set of numbers?

Time:12-11

How can I implement a Split Method to parse just the highlighted object/numbers?

CodePudding user response:

An interesting alternative would be using regular expressions, but since you are asking about split:

Not a single split, but a series of splits.

First split using : character, would give you an array 2 strings:

  • First would contain ...azurecr.io/getaway
  • Second would contain 0.14.0-dev-...

Now the second split would be using the - character and would give you an array of 1 or more items (depending on what line would you parse).

  • First would contain what you need 0.14.0
  • The rest would have the other trash you do not want (dev, 159, g9dd28953)
  • Related