/// <summary> /// Scan with the bounded string for a char equal any of the pattern characters. /// </summary> /// <param name="InBounded"></param> /// <param name="InBx"></param> /// <param name="InPatternChars"></param> /// <returns></returns> public static ScanCharResults ScanEqualAny( BoundedString InBounded, int InBx, char[] InPatternChars) { int Ix; InBounded.ThrowBeforeBounds(InBx); int Lx = InBounded.Ex - InBx + 1; if (Lx <= 0) { Ix = -1; } else { Ix = InBounded.String.IndexOfAny(InPatternChars, InBx, Lx); } if (Ix == -1) { return(new ScanCharResults(-1)); } else { char ch1 = InBounded.String[Ix]; return(new ScanCharResults(ch1, Ix)); } }
/// <summary> /// scan for pattern string within string. /// </summary> /// <param name="InBounded"></param> /// <param name="InBx"></param> /// <param name="InPattern"></param> /// <returns></returns> public static ScanStringResults ScanEqual( BoundedString InBounded, int InBx, string InPattern) { int Ix; InBounded.ThrowBeforeBounds(InBx); int remLx = InBounded.GetRemainingLength(InBx); if (remLx < InPattern.Length) { Ix = -1; } else { Ix = InBounded.String.IndexOf(InPattern, InBx); } if (Ix == -1) { return(new ScanStringResults(-1)); } else { char ch1 = InBounded.String[Ix]; return(new ScanStringResults(InPattern, Ix)); } }