SqlParser关键方法MatchStart(string name,string sql,int position)

///<summary>

///Check whether there is the tag at the specified position in the specified sql

///<sumary>

///<name>The value of the Name property</name>

///<returns>

///The position after the tag or -1 there is no tag at the position.

///</returns>

internal static int MatchStart(string name,string sql,int position)

{

  

   #region Check the arguments

   if (name == null)
    throw new ArgumentNullException("name");

   ParserBase.CheckTextAndPositionArguments(sql, position);

   #endregion

  if(string.Compare(sql,position,name,0,name.Length,true)!=0)

  {

    return -1;

  }

  return position+name.Length;

}

posted @ 2012-05-07 11:39  szjdw  阅读(212)  评论(0编辑  收藏  举报