当前位置: 首页 > news >正文

东莞桥头网站建设58同城网站建设案例

东莞桥头网站建设,58同城网站建设案例,广东珠海网站建设,晋江论坛兔区是什么#x1f33b;#x1f33b; 目录 一、字符串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.… 目录 一、字符串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 可变字符串类 StringBuilder1.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 j0; j 10000;j) {sb.Append(j);}long end2 DateTime.Now.Millisecond;Console.WriteLine(end2-start1);Console.ReadLine();}} }
http://www.dnsts.com.cn/news/165075.html

相关文章:

  • 精品课程网站建设方案在天极网做网站有效果吗
  • 北京城建道桥建设有限公司网站vx网页版
  • 网站维护需要关闭网站么icp备案需要什么材料
  • 公司网站制作步骤商品展示网站模板源码
  • 网站设置价格错误不愿意发货网站建设 空间
  • 爱站seo工具品牌网站建设 十蝌蚪小
  • 浙江省住房和城乡建设厅网站技术支持 沧州网站建设
  • 公司网站域名和空间厦门网站代理
  • 如何在自己网站做直播企业网站建设的基本流程
  • 个人网站需要哪些内容怎么看别人的wordpress
  • intitle 做网站个人网站备案可以做博客吗
  • 沭阳做网站的公司网站线上投票怎样做
  • 大兴高端网站建设WordPress如何屏蔽国内用户
  • 怎么给网站加友情链接河南城市建设网站
  • 佛山网站公司品牌公关具体要做些什么
  • 做网站分为哪些功能的网站网站开发项目教程答案
  • 广东品牌网站建设平台精品课程网站的建设
  • 好看的网站的导航怎么做做推广的网站带宽需要多少
  • 网站定制怎么收费网络营销的实现方式有哪些
  • 青州住房建设局网站wordpress 小工具 导航
  • 手机壁纸网站大全dw做单页网站教程
  • 如何在八戒网便宜做网站网站建设后需要录入
  • 阳春网站开发建立微信群的步骤
  • 手机建站免费厦门企业建站模板
  • 公司网站建设前期方案苏州公司建站
  • 网站体验分析深圳网站建设知了网络
  • 海淀网站设计公司做网站的请示
  • 网站设计与建设报告网址导航怎样推广
  • 宁晋网站建设wordpress固定链接怎么设置好
  • 最好看的免费网站源码微信运营模式