zoukankan      html  css  js  c++  java
  • 字符串分隔

           字符串分隔的各种类型:

                //string s = "hello";
                //char[] chars = s.ToCharArray();
                //chars[0] = 'a';
                //string s1 = new string(chars);
                //Console.WriteLine(s1);
                //bool b = "abc".Equals("ABC",StringComparison.OrdinalIgnoreCase);
                //Console.WriteLine(b);

                //int i = "123".CompareTo("abc");
                //Console.WriteLine(i);
                //Console.ReadKey();
                //string s = "abc,hec,ccc,,fff";
                //string[] strs = s.Split(new char[]{','},StringSplitOptions.RemoveEmptyEntries);
                //foreach (string s1 in strs)
                //{
                //    Console.WriteLine(s1);
                //}
                //Console.ReadKey();
                string s = "我是周杰伦我是刘德华我是韩庚";
                string[] strs = s.Split(new string [] { "我是" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string s1 in strs)
                {
                    Console.WriteLine(s1);
                }
                Console.ReadKey();

  • 相关阅读:
    jsp eclipse 创建jsp项目
    SQL Server 身份验证 登陆
    HUD 5086 Revenge of Segment Tree(递推)
    HDU 1700 Points on Cycle (几何 向量旋转)
    RocketMQ broker jvm 监控
    RocketMQ runbroker.sh 分析JVM启动参数
    问题:虚拟机老生代垃圾回收频繁出现
    空白行 ,空白
    eclipse find 两位数
    生成字母+数字6位字符串
  • 原文地址:https://www.cnblogs.com/wangyhua/p/4050682.html
Copyright © 2011-2022 走看看