zoukankan      html  css  js  c++  java
  • 字符替换

     private void copyClick(object sender, RoutedEventArgs e)
            {
                target.Text = "";
                string from = source.Text;
                for (int i = 0; i != from.Length; i++)
                {
                    char current = from[i];
                    copyOne(current);
                }
            }


            private void copyOne(char current)
            {
                switch (current)
                {
                    case '>':
                        target.Text += ">";
                        break;
                    case '<':
                        target.Text += "&lt;";
                        break;
                    case '"':
                        target.Text += "&#34;";
                        break;
                    default:
                        target.Text += current;
                        break;
                }
    If opportunity doesn’t knock, build a door
  • 相关阅读:
    隐藏NGINX服务器名称 和版本号
    salt-grains
    格式化输出文本的方法
    递归例子
    yield 生成器例子
    Python基础之函数
    Python基础之面向对象
    Python基础之模块2
    Python基础之字符编码
    Python基础之文件操作
  • 原文地址:https://www.cnblogs.com/CandiceW/p/4204566.html
Copyright © 2011-2022 走看看