zoukankan      html  css  js  c++  java
  • 拼接字符串克隆

    <!doctype html>
    <html>
        <head>
            <!--声明当前页面的编码集:charset=gbk,gb2312(中文编码),utf-8国际编码-->
            <meta http-equiv="Content-Type" content="text/html; charset=gbk">
            <script type="text/javascript" src=""></script><!--引入的js  src是引入的js样式路径-->
            <link rel="stylesheet" href="" /><!--引入的css页面的样式 href是引入的css样式路径-->
            <!--当前页面的三要素-->
            <title>字符串拼接</title>
            <meta name="Keywords" content="关键词,关键词">
            <meta name="description" content="">
            <!--css,js-->
            <style type="text/css">
                *{margin:0;padding:0;font-family:"微乳雅黑";font-size:14px;}
                body{background:#2D2D2D;}
                input{color:#fff}
                .w_cont .w_neirong{80%;height:250px;background:#fff;margin:10px auto;border-radius:10px;}
                .w_cont .w_retuse{80%;height:250px;background:#fff;margin:0 auto;margin-top:-25px;border-radius:10px;}
                input{background:#308796;border:1px solid #308796;border-radius:5px;100px;height:35px;}
                p{margin:30px auto;text-align:center;color:#fff;}
                textarea{border:3px solid #6A6A6A;100%;height:250px;border-radius:10px;padding:10px;}
            </style>
        </head>
    <body style="100%;height:100%">
    <div class="w_cont">
        <div class="w_neirong" id="w_neirong">
            <textarea class="w_target" id="target"></textarea>
        </div>
        <p>
            <input type="button" value="转双引号" onclick="shunyinghao()"/>
            <input type="button" value="转双引号为一行" onclick="wfshunyinghao()"/>
        <p>
        <div class="w_retuse" id="w_retuse">
            <textarea class="w_result" id="result"></textarea>
        </div>
    </div>
    <script>
    function dom(id){
       return document.getElementById(id);
    }
    //转多行
    function shunyinghao(){
        var value =dom("target").value;
            value=value.replace(/"/g, "'");
        var s = value.split(" "),
            len = s.length;
        for (var i = 1; i <= len; i++) {
            if ("" != s[i - 1]) {
                s[i - 1] = "str+="" + s[i - 1]+"";";
            }
        }
        dom("result").value = s.join(" ");
        }
    //转一行
    function wfshunyinghao(){
        var value =dom("target").value;
            value="str+="" + value.replace(/"/g, "'").replace(/s/g, "")+"";";
            dom("result").value =value;
    }
    </script>
    </body>
    </html>

  • 相关阅读:
    灰度直方算法 C++
    三国谋士智商前20名
    get the runing time of C++ console program.
    支持向量机 support vector machine
    Typical sentences in SCI papers
    C++调用GDAL库读取并输出tif文件,并计算斑块面积输出景观指数:CSD
    通过管理工具对服务器进行远程管理
    Connected_Component Labelling(联通区域标记算法) C++实现
    Fragstats景观分析研究
    Install GDAL in OpenSUSE 12.3 Linux
  • 原文地址:https://www.cnblogs.com/dreamwf/p/5728004.html
Copyright © 2011-2022 走看看