苹果笔记本做网站的软件/百度搜索引擎优化怎么做
🌻🌻 目录
- 一、字符串
- 1.1 字符类型
- 1.2 转义字符
- 1.3 字符串的声明及赋值
- 1.3.1 c# 中的字符串
- 1.3.2 声明字符串
- 1.3.3 使用字符串
- 1.3.4 字符串的初始化
- 1.3.4.1 引用字符串常量之初始化
- 1.3.4.2 利用字符数组初始化
- 1.3.4.3 提取数组中的一部分进行初始化
- 1.3.5 空字符串与空引用的区别
- 1.3.6 字符串的拼接
- 1.3.7 比较字符串的其它方法
- 1.4 格式化字符串
- 1.4.1 标准数值格式规范
- 1.4.1 标准日期时间格式规范
- 1.4.2 格式化的另外一种方法
- 1.5 截取字符串
- 1.6 分割字符串
- 1.7 插入字符串
- 1.8 删除字符串
- 1.9 复制字符串
- 1.10 替换字符串
- 1.11 可变字符串类
- 1.11.1 string创建的字符串是不可变的
- 1.11.2 可变字符串类 StringBuilder
- 1.11.3 StringBuilder 类常用的方法
- 1.11.4 StringBuilder 类的使用
- 1.11.5 字符串与可变字符串的区别
一、字符串
1.1 字符类型
何时使用字符
遇到字符
'\'
时出现的错误
1.2 转义字符
转义字符使用技巧
1.3 字符串的声明及赋值
1.3.1 c# 中的字符串
1.3.2 声明字符串
1.3.3 使用字符串
1.3.4 字符串的初始化
1.3.4.1 引用字符串常量之初始化
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp6
{class Program{static void Main(string[] args){String str = "时间就是金钱";Console.WriteLine(str);Console.ReadLine();}}
}
1.3.4.2 利用字符数组初始化
1.3.4.3 提取数组中的一部分进行初始化
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp6
{class Program{static void Main(string[] args){char[] array = { '时','间','就','是','金','钱'};string str = new string(array);string str2 = new string(array,4,2);Console.WriteLine(str);Console.WriteLine(str2);Console.ReadLine();}}
}
1.3.5 空字符串与空引用的区别
1.3.6 字符串的拼接
判断用户名是否存在
1.3.7 比较字符串的其它方法
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp6
{class Program{static void Main(string[] args){string str ="mr1";string str2 = "mr12";Console.WriteLine(string.Compare(str,str2));Console.ReadLine();}}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp6
{class Program{static void Main(string[] args){string str ="mr1";string str2 = "mr12";Console.WriteLine(str.CompareTo(str2));Console.ReadLine();}}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp6
{class Program{static void Main(string[] args){string str ="mr1";string str2 = "mr12";Console.WriteLine(str.Equals(str2));Console.ReadLine();}}
}
1.4 格式化字符串
1.4.1 标准数值格式规范
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp6
{class Program{static void Main(string[] args){Console.WriteLine("货币形式:{0:C}",365);Console.WriteLine("科学计数法:{0:E}",12);Console.WriteLine("货币形式:{0:N}",36534);Console.WriteLine("Π取两位小数:{0:F2}",Math.PI);Console.WriteLine("16进制显示:{0:X4}",36);Console.WriteLine("百分比显示:{0:P}",0.99);Console.ReadLine();}}
}
1.4.1 标准日期时间格式规范
1.4.2 格式化的另外一种方法
1.5 截取字符串
从身份证中获取出生日期
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp7
{class Program{static void Main(string[] args){string fileName = "glorysoft.com";string file = fileName.Substring(0, fileName.IndexOf('.'));string fileT = fileName.Substring(fileName.IndexOf('.'));Console.WriteLine(file);Console.WriteLine(fileT);Console.ReadLine();}}
}
索引或者长度超出字符串范围得错误
1.6 分割字符串
限定分割次数
限定分割次数得执行效果
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp7
{class Program{static void Main(string[] args){string fileName = "glorysoft.com.com.com";string[] array = fileName.Split(new char[] { '.' },2);for (int i = 0; i < array.Length; i++) {Console.WriteLine(array[i]);}Console.ReadLine();}}
}
1.7 插入字符串
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp8
{class Program{static void Main(string[] args){string old = "you are a pig";Console.WriteLine(old);string newOld = old.Insert(8, "to");Console.WriteLine(newOld);Console.ReadLine();}}
}
1.8 删除字符串
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp8
{class Program{static void Main(string[] args){string old = "you are a pig";Console.WriteLine(old);string newOld = old.Remove(4);string newOld2 = old.Remove(4,7);Console.WriteLine(newOld);Console.WriteLine(newOld2);Console.ReadLine();}}
}
1.9 复制字符串
复制字符串的一部分
1.10 替换字符串
替换字符串中的字符
替换字符串中的子字符串
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp8
{class Program{static void Main(string[] args){string str = "馒头一文一个";Console.WriteLine(str);string str2 = str.Replace("一", "壹");string str3 = str.Replace("馒头","馍馍");Console.WriteLine(str2);Console.WriteLine(str3);Console.ReadLine();}}
}
替换字符串需要注意的事项
1.11 可变字符串类
1.11.1 string创建的字符串是不可变的
1.11.2 可变字符串类 StringBuilder
定义:
1.11.3 StringBuilder 类常用的方法
1.11.4 StringBuilder 类的使用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp8
{class Program{static void Main(string[] args){StringBuilder sb = new StringBuilder("(),(),(),4, 6, 7、8)");Console.WriteLine(sb);sb.Remove(0, 9);sb.Insert(0,"(门前大桥下),(游过一群鸭),(快来快来数一数),");Console.WriteLine(sb);Console.ReadLine();}}
}
1.11.5 字符串与可变字符串的区别
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;namespace ConsoleApp8
{class Program{static void Main(string[] args){long start = DateTime.Now.Millisecond;string a = "";for (int i = 0; i <= 10000; i++) {a += i;}long end = DateTime.Now.Millisecond;Console.WriteLine(end - start);StringBuilder sb = new StringBuilder();long start1 = DateTime.Now.Millisecond;for (int j=0; j < 10000;j++) {sb.Append(j);}long end2 = DateTime.Now.Millisecond;Console.WriteLine(end2-start1);Console.ReadLine();}}
}
相关文章:

五、C#—字符串
🌻🌻 目录 一、字符串1.1 字符类型1.2 转义字符1.3 字符串的声明及赋值1.3.1 c# 中的字符串1.3.2 声明字符串1.3.3 使用字符串1.3.4 字符串的初始化1.3.4.1 引用字符串常量之初始化1.3.4.2 利用字符数组初始化1.3.4.3 提取数组中的一部分进行初始化 1.3.…...

【Vue3 源码解析】nextTick
nextTick 是 Vue 3 中用于异步执行回调函数的函数,它会将回调函数延迟到下一个微任务队列中执行。其中,Vue 更新 DOM 是异步的。下面是对 nextTick 函数的详细解释: export function nextTick<T void, R void>(this: T,fn?: (this:…...

基于ModebusRTU通信采集温度湿度项目案例
目录 一、模拟温湿度模拟 【1.1】温湿度仪表参数 【1.1】使用电脑模拟传感器 【1.2】使用Codesys软件模拟传感器 二、自定义控件UI设计 【2.1】自定义控件温度湿度柱状设计 编辑 【2.1.1】设置温度湿度柱状实际显示【属性】 【2.1.2】设置温度湿度柱状的背景颜色【属…...

【已解决】关于如何将Doccano标注的文本转换成NER模型可以直接处理的CoNLL 2003格式
笔者要做命名实体识别(NER)的工作,选择了Doccano平台来进行文本标注。 Doccano平台对标注结果的导出格式是JSONL格式,我们导出了NER.jsonl文件。 但是用python语言搭建深度学习模型来实现NER时,一般接收的输入数据格式…...

网络编程day03(UDP中的connect函数、tftp)
今日任务:tftp的文件上传下载(服务端已经准备好) 服务端(已上传) 客户端: 代码: #include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/types.h…...

flarum 论坛 User Statistics插件修改
此插件在中国使用日期不是很理想,于是决定修改代码 下面是插件信息: User Statistics A Flarum extension. Add some user statistics in flarum posts, this extension require clarkwinkelmann/flarum-ext-likes-received and will be installed au…...

阿里云产品试用系列-容器镜像服务 ACR
阿里云容器镜像服务(简称 ACR)是面向容器镜像、Helm Chart 等符合 OCI 标准的云原生制品安全托管及高效分发平台。 ACR 支持全球同步加速、大规模/大镜像分发加速、多代码源构建加速等全链路提效,与容器服务 ACK 无缝集成,帮助企业…...

Langchain里的“记忆力”,让AI只记住有用的事
今天要讲以下内容: 1.ConversationBufferWindowMemory:基于一个固定长度的滑动窗口的“记忆”功能 2.ConversationSummaryMemory:总结对话“记忆”功能 3.ConversationSummaryBufferMemory:上面两个的结合,超过一定…...

从零开始的LINUX(一)
LINUX本质是一种操作系统,用于对软硬件资源进行管理,其管理的方式是指令。指令是先于图形化界面产生的,相比起图形化界面,指令显然更加难以理解,但两者只是形式上的不同,本质并没有区别。 简单的指令&…...

CH34X-MPHSI高速Master扩展应用—I2C设备调试
一、前言 本文介绍,基于USB2.0高速USB转接芯片CH347,配合厂商提供的USB转MPHSI(Multi Protocol High-Speed Serial Interface)Master总线驱动(CH34X-MPHSI-Master)为系统扩展I2C总线的用法,除…...

记一次正式环境升级docker服务基础进行版本异常
因为服务的httpd和tomcat基础镜像版本比较旧,漏洞多,需要升级至最新版本。在本地环境和测试环境都是直接将dockerfile中的FROM基础镜像升级至最新: httpd:由httpd:2.4.52-alpine升级至httpd:2.4.57 tomcat:由4年前的…...

leetcode面试经典150题第一弹(一)
leetcode面试经典150题第一弹 一、合并俩个有序数组(难度:简单) 题目 给你两个按 非递减顺序 排列的整数数组 nums1 和 nums2,另有两个整数 m 和 n ,分别表示 nums1 和 nums2 中的元素数目。 请你 合并 nums2 到 nums1 中,使合并…...

VME-7807RC-414001 350-93007807-414001 VMIVME-017807-411001 VMIVME-017807-414001
VME-7807RC-414001 350-93007807-414001 VMIVME-017807-411001 VMIVME-017807-414001 由于第12代英特尔酷睿处理器的16核/24线程配置,Nuvo-9000型号与之前的平台相比,性能大幅提升。它们还支持新的DDR5内存标准,以获得更多内存带宽…...

01-Zookeeper特性与节点数据类型详解
上一篇: 在了解Zookeeper之前,需要对分布式相关知识有一定了解,什么是分布式系统呢?通常情况下,单个物理节点很容易达到性能,计算或者容量的瓶颈,所以这个时候就需要多个物理节点来共同完成某项…...

TP6 TP8 使用阿里官方OSS SDK方法
安装 composer require aliyuncs/oss-sdk-php 官网:GitHub - aliyun/aliyun-oss-php-sdk: Aliyun OSS SDK for PHP 二、PHP简单上传 官网教程:如何进行字符串上传和文件上传_对象存储 OSS-阿里云帮助中心 引入 use OSS\OssClient; use OSS\Core\OssE…...

SkyWalking分布式链路追踪学习
为什么要用分布式链路追踪 实际生产中,面对几十个、甚至成百上千个的微服务实例,如果一旦某个实例发生宕机,如果不能快速定位、提交预警,对实际生产造成的损失无疑是巨大的。所以,要对微服务进行监控、预警࿰…...

git revert 撤销之前的提交
git revert 用来撤销之前的提交,它会生成一个新的 commit id 。 输入 git revert --help 可以看到帮忙信息。 git revert commitID 不编辑新的 commit 说明 git log 找到需要撤销的 commitID , 然后执行 git revert commitID ,会提示如下…...

rk3568环境配置和推理报错: RKNN_ERR_MALLOC_FAIL
前言 最近在部署算法在板子侧遇到的一些问题汇总一下: 一、版本问题 经过测试现在将自己环境配置如下: 本地linux安装rknn-toolkit2-1.5.0 本地Linux使用的miniconda新建的一个python虚拟环境(自行网上查找相关方法) 安装好自…...

网络工程师基础笔记(一)
一、接入网 接入网,是指将端系统物理连接到边缘路由器的网络。 (1)家庭接入:数字用户线(DSL)、电缆、光纤到户(FTTH)卫星和拨号接入。 (2)企业(家庭)接入&…...

Postman应用——Headers请求头设置
文章目录 Header设置Header删除或禁用Header批量编辑Header预设添加 一般在接口需要校验签名时,Headers请求头用来携带签名和生成签名需要的参数,在Postman也可以设置请求头在接口请求时携带参数。 Header设置 说明: Key:Header…...

人人都是项目经理-项目管理概述(一)
一、重新认识项目管理 1. 什么是项目 项目(Project),是为提供某项独特的产品(交付物),服务或成果所做的临时性努力。 – PMBOK指南 项目是指一系列独特的、复杂的并相互关联的活动,这些活动有着…...

浅谈基于物联网的医院消防安全管理
安科瑞 华楠 摘 要:医院消防物联网将原本与网络无关的消防设施和网络结合起来,将消防监督管理、防火灭火所需的相关信息进行汇总,可以让医院更加轻松地发现和处理医院的警情信息,降低火灾发生频率。 关键词:物联网技…...

户用储能争斗:华宝新能“稳”、正浩科技“快”、安克创新“急”
便携式储能市场一片红海,户用储能(家用储能)成为储能企业新的“格斗场”。 过去两年,房车游、户外旅行、露营等旅游项目热度攀升,户外用电需求与日俱增,嗅觉敏锐的资本方相继加码便携储能市场,越…...

【面试篇】集合相关高频面试题
目录 1. ArrayList和LinkedList的区别?2. HashMap和HashTable的区别?1. ArrayList和LinkedList的区别? ArrayListLinkedList数据结构数组链表插入和删除在中间插入或删除元素时需要移动数组中的其他元素,时间复杂度为O(n)只需要调整指针,时间复杂度为O(1)访问元素通过索引…...

RT Preempt linux学习笔记
RT Preempt linux学习笔记 一、实时操作系统(Realtime Operating System) 1. 什么是实时操作系统 A real-time system is a time-bound system which has well-defined, fixed time constraints. Processing must be done within the defined constra…...

JavaScript 基础第四天笔记
JavaScript 基础 - 第4天笔记 理解封装的意义,能够通过函数的声明实现逻辑的封装,知道对象数据类型的特征,结合数学对象实现简单计算功能。 理解函数的封装的特征掌握函数声明的语法理解什么是函数的返回值知道并能使用常见的内置函数 函数 …...

Unity 2021.x及以下全版本Crack
前言 最近Unity那档子事不出来了吗,搞得所有人都挺烦的,顺便在公司内网需要我完成一个游戏的项目,就研究了一下如何将Unity给Crack掉。 注意所有操作应有连接外网的权限 以我选择的版本为例,我使用的是Unity 2021.3.5f1与Unity…...

基于知识蒸馏的夜间低照度图像增强及目标检测
源自:应用光学 作者:苗德邻, 刘磊, 莫涌超, 胡朝龙, 张益军, 钱芸生. “人工智能技术与咨询” 发布 摘要 为了实现夜间低照度图像的增强,提高目标检测模型在夜间低照度条件下的检测精度并减小模型的计算成本,提出了一种基…...

4、ARM异常处理
一、异常处理 1、异常 概念 处理器在正常执行程序的过程中可能会遇到一些不正常的的事件发生,这时处理器就要将当前的程序暂停下来转去处理这个异常的事件,异常事件完成后再返回到之前被异常打断的点继续执行 2、异常处理机制 不同的处理器对异常的…...

【Element-UI】CUD(增删改)及form 表单验证(附源码)
目录 一、导言 1、引言 2、作用 二、CUD 1、增加修改 1.1、添加弹窗 1.2、定义变量 1.3、定义方法 1.4、完整代码 2、删除 2.1、定义方法 三、表单验证 1、添加规则 2、定义规则 3、提交事件 4、前端完整代码 一、导言 1、引言 增删改是计算机编程和数据库管理…...