text: public static string getSchemePrefix(string spec){int colon = spec.IndexOf(':');if (colon < 1){return null;}{for (int i = 0; i < colon; i++){char c = spec[i];if (!isValidSchemeChar(i, c)){return null;}}}return Sharpen.StringHelper.Substring(spec, 0, colon).ToLower(System.Globalization.CultureInfo.InvariantCulture);}