Skip to content

Commit 82b8123

Browse files
committed
Allow multiple separators split
1 parent ab94855 commit 82b8123

File tree

1 file changed

+3
-1
lines changed
  • CollapseLauncher/Classes/Interfaces/Class

1 file changed

+3
-1
lines changed

CollapseLauncher/Classes/Interfaces/Class/Structs.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ public GameVersion(string? version)
145145

146146
public static bool TryParse(string? version, [NotNullWhen(true)] out GameVersion? result)
147147
{
148+
const string Separators = ",.;|";
149+
148150
result = null;
149151
if (string.IsNullOrEmpty(version))
150152
{
@@ -153,7 +155,7 @@ public static bool TryParse(string? version, [NotNullWhen(true)] out GameVersion
153155

154156
Span<Range> ranges = stackalloc Range[8];
155157
ReadOnlySpan<char> versionSpan = version.AsSpan();
156-
int splitRanges = versionSpan.Split(ranges, '.', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
158+
int splitRanges = versionSpan.SplitAny(ranges, Separators, StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
157159

158160
if (splitRanges == 0)
159161
{

0 commit comments

Comments
 (0)