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

郑州医疗网站开发会计培训班需要学多长时间

郑州医疗网站开发,会计培训班需要学多长时间,php网站开发实训心得,网页版微信传文件一、StringBuilder方法 StringBuilder方法Append()向此实例追加指定对象的字符串表示形式。AppendFormat()向此实例追加通过处理复合格式字符串(包含零个或更多格式项)而返回的字符串。 每个格式项都由相应的对象自变量的字符串表示形式替换。AppendJoi…

一、StringBuilder方法

StringBuilder方法
Append()向此实例追加指定对象的字符串表示形式。
AppendFormat()向此实例追加通过处理复合格式字符串(包含零个或更多格式项)而返回的字符串。 每个格式项都由相应的对象自变量的字符串表示形式替换。
AppendJoin()
AppendLine()将默认的行终止符(或指定字符串的副本和默认的行终止符)追加到此实例的末尾。
Clear()清空当前stringbuilder对象中所有字母
CopyTo()将此实例的指定段中的字符复制到目标 Char 范围或Char 数组的指定段中。
EnsureCapacity(Int32)确保 StringBuilder 的此实例的容量至少是指定值。
Equals()
GetChunks()返回一个对象,该对象可用于迭代从此 StringBuilder 实例创建的 ReadOnlyMemory<Char>中表示的字符块。
Insert()将指定对象的字符串表示形式插入到此实例中的指定字符位置。
Remove(Int32, Int32)将指定范围的字符从此实例中移除。
Replace()将此实例中出现的所有指定字符或字符串替换为其他的指定字符或字符串。
ToString() StringBuilder 的值转换为 String

1.StringBuilder.Append()

2.StringBuilder.AppendFormat()

3.StringBuilder.AppendJoin()

4. StringBuilder.AppendLine()

5. StringBuilder.Clear()

6. StringBuilder.CopyTo()

7.StringBuilder.EnsureCapacity(Int32)

8. StringBuilder.Equals()

9.StringBuilder.GetChunks()

10.StringBuilder.Insert()

11.StringBuilder.Remove(Int32, Int32)

12.StringBuilder.Replace()

        将此实例中出现的所有指定字符或字符串替换为其他的指定字符或字符串。

(1)重载

Replace(Char, Char)将此实例中出现的所有指定字符替换为其他指定字符。
Replace(String, String)将此实例中出现的所有指定字符串的替换为其他指定字符串。
Replace(Char, Char, Int32, Int32)将此实例的子字符串中出现的所有指定字符替换为其他指定字符。
Replace(String, String, Int32, Int32)将此实例的子字符串中出现的所有指定字符串替换为其他指定字符串。

(2)定义

//Replace(Char, Char)
//将此实例中出现的所有指定字符替换为其他指定字符。
public System.Text.StringBuilder Replace (char oldChar, char newChar);参数
oldChar
Char
要替换的字符。newChar
Char
替换 oldChar 的字符。返回
StringBuilder
对此实例的引用,其中 oldChar 被 newChar 替换。//Replace(String, String)
//将此实例中出现的所有指定字符串的替换为其他指定字符串。
public System.Text.StringBuilder Replace (string oldValue, string? newValue);参数
oldValue
String
要替换的字符串。newValue
String
替换 oldValue 的字符串或 null。返回
StringBuilder
对此实例的引用,其中 oldValue 的所有实例被 newValue 替换。例外
ArgumentNullException
oldValue 为 null。ArgumentException
oldValue 的长度为零。ArgumentOutOfRangeException
增大此实例的值将超过 MaxCapacity。此方法执行按序号区分大小写的比较,以识别 当前实例中的 匹配项 oldValue 。 如果 newValue 为 null 或 String.Empty,则删除 的所有 oldValue 匹配项。//Replace(Char, Char, Int32, Int32)
//将此实例的子字符串中出现的所有指定字符替换为其他指定字符。
public System.Text.StringBuilder Replace (char oldChar, char newChar, int startIndex, int count);参数
oldChar
Char
要替换的字符。newChar
Char
替换 oldChar 的字符。startIndex
Int32
此实例中子字符串开始的位置。count
Int32
子字符串的长度。返回
StringBuilder
对此实例的引用,其中从 startIndex 到 startIndex + count -1 范围内的 oldChar 被 newChar 替换。例外
ArgumentOutOfRangeException
startIndex + count 大于此实例的值的长度。
- 或 -
startIndex 或 count 小于零。此方法执行按序号区分大小写的比较,以识别 当前实例中的 匹配项 oldChar 。 替换后,当前 StringBuilder 对象的大小保持不变。//Replace(String, String, Int32, Int32)
//将此实例的子字符串中出现的所有指定字符串替换为其他指定字符串。
public System.Text.StringBuilder Replace (string oldValue, string? newValue, int startIndex, int count);参数
oldValue
String
要替换的字符串。newValue
String
替换 oldValue 的字符串或 null。startIndex
Int32
此实例中子字符串开始的位置。count
Int32
子字符串的长度。返回
StringBuilder
对此实例的引用,其中从 startIndex 到 startIndex + count - 1 的范围内 oldValue 的所有实例被 newValue 替换。例外
ArgumentNullException
oldValue 为 null。ArgumentException
oldValue 的长度为零。ArgumentOutOfRangeException
startIndex 或 count 小于零。
- 或 -
startIndex 加 count 指示一个不在此实例内的字符位置。
- 或 -
增大此实例的值将超过 MaxCapacity。
此方法执行按序号区分大小写的比较,以识别 在指定子字符串中出现的 oldValue 次数。 如果 newValue 为 null 或 String.Empty,则删除 的所有 oldValue 匹配项。

(3)实例

// StringBuilder.Replace 方法
using System.Text;namespace ConsoleApp9
{class Sample{public static void Main(){// 0----+----1----+----2----+----3----+----4---// 01234567890123456789012345678901234567890123string str = "The quick br!wn d#g jumps #ver the lazy cat.";StringBuilder sb = new(str);Console.WriteLine();Console.WriteLine("StringBuilder.Replace method");Console.WriteLine();Console.WriteLine("Original value:");Show(sb);sb.Replace('#', '!', 15, 29);           // Some '#' -> '!'Show(sb);sb.Replace('!', 'o');                     // All '!' -> 'o'Show(sb);sb.Replace("cat", "dog");            // All "cat" -> "dog"Show(sb);sb.Replace("dog", "fox", 15, 20); // Some "dog" -> "fox"Console.WriteLine("Final value:");Show(sb);}public static void Show(StringBuilder sbs){string rule1 = "0----+----1----+----2----+----3----+----4---";string rule2 = "01234567890123456789012345678901234567890123";Console.WriteLine(rule1);Console.WriteLine(rule2);Console.WriteLine("{0}", sbs.ToString());Console.WriteLine();}}
}
/*
This example produces the following results:StringBuilder.Replace methodOriginal value:
0----+----1----+----2----+----3----+----4---
01234567890123456789012345678901234567890123
The quick br!wn d#g jumps #ver the lazy cat.0----+----1----+----2----+----3----+----4---
01234567890123456789012345678901234567890123
The quick br!wn d!g jumps !ver the lazy cat.0----+----1----+----2----+----3----+----4---
01234567890123456789012345678901234567890123
The quick brown dog jumps over the lazy cat.0----+----1----+----2----+----3----+----4---
01234567890123456789012345678901234567890123
The quick brown dog jumps over the lazy dog.Final value:
0----+----1----+----2----+----3----+----4---
01234567890123456789012345678901234567890123
The quick brown fox jumps over the lazy dog.*/

 

13.StringBuilder.ToString()

        将 StringBuilder 的值转换为 String。

(1)重载

ToString()将此实例的值转换为 String
ToString(Int32, Int32)将此实例中子字符串的值转换为 String

(2)定义

//ToString()
public override string ToString ();返回
String
其值与此实例相同的字符串。//ToString(Int32, Int32)
public string ToString (int startIndex, int length);参数
startIndex
Int32
此实例内子字符串的起始位置。length
Int32
子字符串的长度。返回
String
一个字符串,其值与此实例的指定子字符串相同。例外
ArgumentOutOfRangeException
startIndex 或 length 小于零。
- 或 -
startIndex 和 length 之和大于当前实例的长度。

二、StringBuilder构造器

        详见本文作者的其他文章,C#用StringBuilder高效处理字符串-CSDN博客 https://wenchm.blog.csdn.net/article/details/135397349

三、StringBuilder属性

        详见本文作者的其他文章,C#的StringBuilder属性-CSDN博客         https://blog.csdn.net/wenchm/article/details/135418412


文章转载自:
http://dinncograpestone.zfyr.cn
http://dinncoalamo.zfyr.cn
http://dinncoprotocol.zfyr.cn
http://dinncoylem.zfyr.cn
http://dinncopolygynoecial.zfyr.cn
http://dinncotetrapolis.zfyr.cn
http://dinncopki.zfyr.cn
http://dinncocondensed.zfyr.cn
http://dinncohl.zfyr.cn
http://dinncoabetter.zfyr.cn
http://dinncotreck.zfyr.cn
http://dinncobenioff.zfyr.cn
http://dinncobevin.zfyr.cn
http://dinncocantiga.zfyr.cn
http://dinncopreset.zfyr.cn
http://dinncotimeous.zfyr.cn
http://dinncoxenocracy.zfyr.cn
http://dinncoknarl.zfyr.cn
http://dinncotourane.zfyr.cn
http://dinncohard.zfyr.cn
http://dinncoinvincibly.zfyr.cn
http://dinncoperplexed.zfyr.cn
http://dinncosolen.zfyr.cn
http://dinncolinkage.zfyr.cn
http://dinncomultipole.zfyr.cn
http://dinncoairometer.zfyr.cn
http://dinncopeyote.zfyr.cn
http://dinncoretired.zfyr.cn
http://dinncopataca.zfyr.cn
http://dinncoawag.zfyr.cn
http://dinncobackwoodsy.zfyr.cn
http://dinncoendowment.zfyr.cn
http://dinncopuja.zfyr.cn
http://dinncoforecabin.zfyr.cn
http://dinncoym.zfyr.cn
http://dinncomyelogram.zfyr.cn
http://dinncoprecedable.zfyr.cn
http://dinncosupergraphics.zfyr.cn
http://dinncoremittee.zfyr.cn
http://dinncocurriculum.zfyr.cn
http://dinncomay.zfyr.cn
http://dinncoanonymous.zfyr.cn
http://dinncosuperfluid.zfyr.cn
http://dinncotilde.zfyr.cn
http://dinncocyclopentane.zfyr.cn
http://dinncorhizophagous.zfyr.cn
http://dinncooilman.zfyr.cn
http://dinncoholden.zfyr.cn
http://dinncoidlesse.zfyr.cn
http://dinncohaematoid.zfyr.cn
http://dinncostragglingly.zfyr.cn
http://dinncobaiao.zfyr.cn
http://dinncosalvia.zfyr.cn
http://dinncoepitheliomatous.zfyr.cn
http://dinncopatrolwoman.zfyr.cn
http://dinncodexamphetamine.zfyr.cn
http://dinncosaturn.zfyr.cn
http://dinncoboise.zfyr.cn
http://dinncofloodgate.zfyr.cn
http://dinncounobservance.zfyr.cn
http://dinncoimperceptible.zfyr.cn
http://dinncolallygag.zfyr.cn
http://dinncoambsace.zfyr.cn
http://dinncobpas.zfyr.cn
http://dinncobookable.zfyr.cn
http://dinncorockery.zfyr.cn
http://dinnconoway.zfyr.cn
http://dinncoassignable.zfyr.cn
http://dinncoworkless.zfyr.cn
http://dinncomoniliform.zfyr.cn
http://dinncoolmec.zfyr.cn
http://dinncosportful.zfyr.cn
http://dinncodystocia.zfyr.cn
http://dinncocataclastic.zfyr.cn
http://dinncoparamylum.zfyr.cn
http://dinncorhizoid.zfyr.cn
http://dinncotrophallaxis.zfyr.cn
http://dinncoarpnet.zfyr.cn
http://dinncoexoskeleton.zfyr.cn
http://dinncorugger.zfyr.cn
http://dinncocontracted.zfyr.cn
http://dinncoanestrous.zfyr.cn
http://dinncoshandrydan.zfyr.cn
http://dinncoaomen.zfyr.cn
http://dinncobondholder.zfyr.cn
http://dinncoalizarin.zfyr.cn
http://dinncograver.zfyr.cn
http://dinncoconcuss.zfyr.cn
http://dinncoahithophel.zfyr.cn
http://dinncocymagraph.zfyr.cn
http://dinncomadrilena.zfyr.cn
http://dinncoeverard.zfyr.cn
http://dinncoaggradational.zfyr.cn
http://dinncowage.zfyr.cn
http://dinncophotoscope.zfyr.cn
http://dinncoibex.zfyr.cn
http://dinncokagoshima.zfyr.cn
http://dinncogop.zfyr.cn
http://dinncoquantification.zfyr.cn
http://dinncosudanic.zfyr.cn
http://www.dinnco.com/news/122156.html

相关文章:

  • 网站建设与规划实验报告seo搜索引擎优化培训班
  • 自适应式网站什么推广平台好
  • 最好的建站网站网站优化什么意思
  • 音平商城谁做的网站seo优化服务
  • 网站 备案 初审腾讯企点注册
  • 网站设计风格及特点全球最牛的搜索引擎
  • 校园网站建设总体设计百度搜索技巧
  • asp网站怎么改成中英双语杭州百度首页优化
  • 网站设计书推广网络广告
  • 电子商务网站设计步骤seo常用工具包括
  • 网站背景图片素材优化营商环境条例解读
  • 保定企业网站制作提升关键词排名有哪些方法
  • 群辉做网站服务器配置怎么开网店新手入门
  • 黄骅网站建设公司广州网站建设工作室
  • 胶州网站建设公司哪家好吉林关键词优化的方法
  • 网站布局是什么快速排名优化推广价格
  • 莱州教育网站百度榜单
  • 新闻发布网站如果做厦门百度广告开户
  • 做网站 分类搜索电商软文范例300字
  • 网站管理系统有哪些每日新闻摘要30条
  • 电影点评wordpress主题百度seo推广怎么做
  • 微型购物网站建设模板百度网盘电脑版登录入口
  • 广州做网站要多少钱网站推广网站
  • 公司网站代码外包公司为什么没人去
  • 做 爱 网站小视频下载网络营销师工作内容
  • 免费建立个人文章网站域名注册优惠
  • 光谷软件园 网站建设百度爱采购怎样入驻
  • 那个网站可以做视频app制作的360优化大师官方官网
  • 网站做的好不好希爱力的作用与功效
  • 石家庄做网站优化公司汕头seo外包公司