[Solved] How to split a string by a specific character? [duplicate]

[ad_1]

var myString = "0001-102525";
var splitString = myString.Split("-");

Then access either like so:

splitString[0] and splitString[1]

Don’t forget to check the count/length if you are splitting user inputted strings as they may not have entered the ‘-‘ which would cause an OutOfRangeException.

[ad_2]

solved How to split a string by a specific character? [duplicate]