差异化竞争阵地的所在【周技术进阶】-从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();
        }
    }
}
相关推荐
漏洞文库-Web安全13 分钟前
AWD比赛随笔
开发语言·python·安全·web安全·网络安全·ctf·awd
张人玉29 分钟前
C#通信精讲系列——C# 通讯编程基础(含代码实例)
开发语言·c#·c#通信
小熊熊知识库35 分钟前
C# Ollama 实战聊天小案例实现
开发语言·c#
哈哈xcpc-439943 分钟前
天梯赛题解(Python和C++解法)
开发语言·c++·python
A Mr Yang43 分钟前
JAVA 对比老、新两个列表,找出新增、修改、删除的数据
java·开发语言·spring boot·后端·spring cloud·mybatis
星释1 小时前
Rust 练习册 120:探索向量与斐波那契数列
开发语言·后端·rust
arron88991 小时前
WebApi 部署到win7 IIS详细步骤
c#
zmzb01031 小时前
C++课后习题训练记录Day47
开发语言·c++
零点零一1 小时前
C# 的 out 参数:全面解析与最佳实践
c#
北极糊的狐1 小时前
报错java: 找不到符号符号: 类 XxxController位置: 程序包 com.ruoyi.xxx.xxx.service
开发语言·windows·python