The code line string[] separator = {"::"};
is initializing array separator
. This syntax to initialize the array is referred as Implicitly Typed Arrays.
Currently your code using Split(String[], StringSplitOptions)
method of string to split the string where the first arg is type of string array. If you have only one seperator (i.e. ::
) then you can use the overload method Split(String, StringSplitOptions)
by below code
string separator = "::";
var seperatedCardString = currentCard.Name.Split(
separator, StringSplitOptions.RemoveEmptyEntries);
Check all the overload of string Split
method at here
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…