Skip to content

Instantly share code, notes, and snippets.

@amieres
Created May 13, 2014 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amieres/0ef3dcf02b4714183c1e to your computer and use it in GitHub Desktop.
Save amieres/0ef3dcf02b4714183c1e to your computer and use it in GitHub Desktop.
String Input = null;
int LastPosition = -1;
int SpaceLength = 0;
void SkipSpacesComments() {
if (Position == LastPosition) return;
LastPosition = Position;
CurrentString = Input.Substring(Position);
string RegEx = "^([ \\t\\n\\r]|\\/\\*.*?\\*\\/)*";
Match M = Regex.Match(CurrentString, RegEx);
SpaceLength = M.Length;
if (SpaceLength > 0)
CurrentString = CurrentString.Substring(SpaceLength);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment