zoukankan      html  css  js  c++  java
  • C#-String字符串操作

    贴代码。这些都是方法,不懂的留言

            private void StSplit()
            { 
                //检查所有字符串符号相同去掉
                Char[] delimiChars = { ' ', ',', '.', ':', '	' };
                string text = "one	two three:four,five six seven";
                tbText.Text = text;
                string[] words = text.Split(delimiChars);
                foreach (string s in words)
                {
                    //数组遍历 组合
                    st2 = st2 + s;
                    log.Info("s===" + s);
                    log.Info("st2==" + st2);
                }
                tbtext2.Text = st2;
                // 输出格式:onetwothreefourfivesixseven
    
            }
    
    
            public void St_Replace()
            {
                st = "123 123456 85797 
    abc def adcc abaaa";
                tbText.Text = st;
                //替换字符 全部替换
                String st2 = st.Replace("123", "333");
                tbtext2.Text = st2;
                /* 
                 * *输出格式:333 333456 85797 
                              abc def adcc abaaa
                 * * */
            }
  • 相关阅读:
    hdu1421 搬寝室(dp)
    HDU 2577(DP)
    扩展欧几里德算法
    unique函数的作用
    区间更新 zoj3911
    set的应用
    vue 事件处理器
    vue Class与style绑定
    vue的计算属性
    sass入门
  • 原文地址:https://www.cnblogs.com/hs22/p/6896872.html
Copyright © 2011-2022 走看看