public static bool IsHexEncoding(String value, int index) { if (index + 2 >= value.Length) { return(false); } return(value[0] == '%' && SparqlSpecsHelper.IsHex(value[1]) && SparqlSpecsHelper.IsHex(value[2])); }
/// <summary> /// Return true if the character sequence starting at the specifie offset is a URI hex-encoded character /// </summary> /// <param name="str">The input string</param> /// <param name="index">The character offset from which to start the check for a hex-encoded character</param> /// <returns></returns> public static bool IsHexEncoding(this String str, int index) { if (index + 2 >= str.Length) { return(false); } return(str[0] == '%' && SparqlSpecsHelper.IsHex(str[1]) && SparqlSpecsHelper.IsHex(str[2])); }