// Expected runtime name format: kre-{FLAVOR}-{OS}-{ARCHITECTURE}.{VERSION} // Sample input: kre-coreclr-win-x86.1.0.0.0 // Sample output: 1.0.0.0 private static string GetRuntimeVersion(BundleRuntime runtime) { if (runtime == null) { return(string.Empty); } var segments = runtime.Name.Split(new[] { '.' }, 2); return(segments[1]); }
// Expected runtime name format: kre-{FLAVOR}-{OS}-{ARCHITECTURE}.{VERSION} // Sample input: kre-coreclr-win-x86.1.0.0.0 // Sample output: coreclr private static string GetRuntimeFlavor(BundleRuntime runtime) { if (runtime == null) { return(string.Empty); } var segments = runtime.Name.Split(new[] { '.' }, 2); segments = segments[0].Split(new[] { '-' }, 4); return(segments[1]); }
// Expected runtime name format: kre-{FLAVOR}-{OS}-{ARCHITECTURE}.{VERSION} // Sample input: kre-coreclr-win-x86.1.0.0.0 // Sample output: 1.0.0.0 private static string GetRuntimeVersion(BundleRuntime runtime) { if (runtime == null) { return string.Empty; } var segments = runtime.Name.Split(new[] { '.' }, 2); return segments[1]; }
// Expected runtime name format: kre-{FLAVOR}-{OS}-{ARCHITECTURE}.{VERSION} // Sample input: kre-coreclr-win-x86.1.0.0.0 // Sample output: coreclr private static string GetRuntimeFlavor(BundleRuntime runtime) { if (runtime == null) { return string.Empty; } var segments = runtime.Name.Split(new[] { '.' }, 2); segments = segments[0].Split(new[] { '-' }, 4); return segments[1]; }