zoukankan      html  css  js  c++  java
  • 函数单词首字母大写并返回字符串

    static void strFirstUpr(Args _args)
    {
        container strFirstUpr(str _str)
        {
            container conRet;
            int         i;
            str         strTmp;
            ;
            conRet = NJ_MF_str2con(_str," ");
          for(i=1;i<=conlen(conRet);i++)
          {
            strTmp = conpeek(conRet,i);
            strTmp = strlwr(strTmp);
            strTmp = strupr(SubStr(strTmp,1,1))+Substr(strTmp,2,StrLen(strTmp));
            conret = conpoke(conRet,i,strTmp);
            print conpeek(conret,i);
          }
          return conRet;
        }
        str strFirstUpr2(str _str)
        {
            str tmp,retStr;
            int i;
            boolean firstStr;
            ;
            firstStr = true;
            tmp = strLwr(_str);
            for (i=1; i<=strlen(tmp); i++)
            {
                if(firstStr)
                {
                 retStr += strUpr(substr(tmp,i,1));
                }
                else
                {
                    retStr += substr(tmp,i,1);
                }
                if(substr(tmp,i,1) == " ")
                    firstStr = true;
                else
                    firstStr = false;
            }
            return retStr;
        }
        ;
        print strFirstUpr2("HELLO yOu yes   hAO AN NOT,");
        pause;
    }

  • 相关阅读:
    关于对defer的理解.
    JAVA文件操作类和文件夹的操作
    跟我学XSL(一)
    .NET Remoting程序开发入门篇(一)
    jboss配置入门(一)
    SQL2000 关于 Java JDBC 驱动的安装和设定
    XSL基础教程(三)
    利用WSCF进行契约先行的Web Services开发
    Log4Net使用指南
    java存储过程调用(sqlsever数据库)
  • 原文地址:https://www.cnblogs.com/perock/p/2252895.html
Copyright © 2011-2022 走看看