当前位置:首页 » 多媒体相关

一个简单的语句问题


匹配一句话的其中一段字符的语句如何写呢?  
  如匹配filter中的“il”  
  如匹配“中国人”中的“国”...

推荐阅读

  • IT [详细内容]
  • 9600XT遇到DDRII 斯巴达克9600XT测试 [详细内容]
  • 853短信平台的快捷操作 [详细内容]
  • IT [详细内容]
  • Harris赢得伊拉克9600万美元的合同 [详细内容]
  • 刚发现的彩灯新用途 [详细内容]
  • IT [详细内容]
  • 网友回答:
    网友:huojiehai

    str   :=   filter;  
      if   pos(il,   str)   >   0   then    
          showmessage(找到);

    网友:karach

    select   *   from   table  
      where   字段名   like   %国%

    网友:cnhgj

    字符串操作用一楼兄,数据库查询用二、三楼兄

    网友:xuejinlong

    用pos函数,看一下帮助就明白了。

    网友:nature

    你要sql语句还是pascal?  
      sql:select   *   from   table1   where   aa   like   %il%  
       
      pascl:pos(il,fielter)>0

    网友:xuejinlong

    returns   the   index   value   of   the   first   character   in   a   specified   substring   that   occurs   in   a   given   string.  
       
      unit  
       
      system  
       
      category  
       
      string   handling   routines  
       
      delphi   syntax:  
       
      function   pos(substr:   string;   s:   string):   integer;  
       
      description  
       
      in   delphi,   pos   searches   for   a   substring,   substr,   in   a   string,   s.   substr   and   s   are   string-type   expressions.  
       
      pos   searches   for   substr   within   s   and   returns   an   integer   value   that   is   the   index   of   the   first   character   of   substr   within   s.   pos   is   case-sensitive.   if   substr   is   not   found,   pos   returns   zero.  
       
      the   posex   function   is   similar   to   pos,   but   provides   additional   features   and   can   be   used   in   c++   code.  
      -------------------------------------------------------------------------  
       
      如果要在edit1.text里面查询“中国”两个字符,则:  
       
          pos(中国,edit1.text);  
       
      如果查到,返回值是“中国”在edit1.text中第一次出现的位置,如果没查到,返回0

    .

    讨论区

    Login