差异化竞争阵地的所在【周技术进阶】-从BS 项目C#最基础截取字符串方法开始

效果

代码

cs 复制代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleAppNumberOneHelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("hello world!2020Year!");
            
                 #region 2 截取字符串方法
            //
            string originalString = "Hello, World!";
            string truncatedString = originalString.Substring(0, 5); // 截取从索引0开始的5个字符;  会获取到Hello内容打印出来; 8.31
            Console.WriteLine(truncatedString);
            //截取前6个字符;
            string sixS = originalString.Substring(0, 6);
            Console.WriteLine(sixS);
            //W1
            string str = "业务为先,代码再写的顺序,才是正确的写代码入门的方式所在,以至于进阶所在!";

            string waterStr2 = str.Substring(0, 12);
            Console.WriteLine(waterStr2);




            #endregion
            Console.ReadLine();
        }
    }
}
相关推荐
星空椰4 小时前
Python 面向对象高级:继承与类定义详解
开发语言·python
白露与泡影4 小时前
2026大厂Java面试题大全!牛客网最新版
java·开发语言
凯瑟琳.奥古斯特4 小时前
高阶子查询题目精炼
开发语言·数据库·python·职场和发展·数据库开发
雪度娃娃5 小时前
转向现代C++——在意为改写的函数添加 override
开发语言·c++
喵星人工作室6 小时前
C++火影忍者1.1.2
开发语言·c++
basketball6166 小时前
C++ 中的 ptrdiff_t 详解
开发语言·c++
月亮邮递员6166 小时前
Markdown语法总结
开发语言·前端·javascript
printfLILEI6 小时前
php中的类与对象以及反序列化
linux·开发语言·php
曹牧6 小时前
C#:主线程能够捕获到子线程中的异常
开发语言·数据库·c#
代码中介商6 小时前
深入解析STL中的stack、queue与priority_queue
开发语言·c++