zoukankan      html  css  js  c++  java
  • String匹配函数

    function findString(t:String,g:String){
       var num:int = t.length;
       var bool = true;
       for(var i = 0; i< num; i++){
           if(t[i] == g[0]){
             for(var h = 0; h < g.length; h++){
              if(t[i+h] != g[h])
                 bool = false;
             }
           }
       }
      
       return bool;
    }

    ///////////////////////////////////////////////

    #pragma strict
    var s:String="sdfsdfsdfsdf";
    function Start () {
         if(s.IndexOf("fsd")>0){
               print("包含fsd字符串");
         } else {
               print("不包含");
         }
    }
  • 相关阅读:
    poj 2942 Knights of the Round Table 双连通分量
    zoj 2588 Burning Bridges 桥
    desin pattern
    android
    ubuntu
    centos
    android布局
    gradle
    好站
    tomcat datasource
  • 原文地址:https://www.cnblogs.com/softimagewht/p/2614259.html
Copyright © 2011-2022 走看看