
C#
myby
人生如戏,生死看淡,不服就干。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C# string.Format()方法的使用
Format(String, Object) 将字符串中的一个或多个格式项替换为指定对象的字符串表示形式。Format(String, Object[]) 将指定字符串中的格式项替换为指定数组中相应对象的字符串表示形式。Format(IFormatProvider, String, Object) 将指定字符串中的一个或多个格式项替换为对应对象的字符串表示形式。 参数提供区域性特定的格式...原创 2019-08-13 12:54:27 · 11837 阅读 · 0 评论 -
C# string类 PadLeft/PadRight方法
PadLeft方法在字符串左侧进行填充,PadRight方法在字符串右侧进行填充。public string PadLeft(int totalWidth,char paddingChar)totalWidth指定填充后的字符串长度 paddingChar用于填充的字符,如果省略填充空格。 string s1 = "我是小哥哥"; ...原创 2019-08-13 13:20:03 · 3357 阅读 · 0 评论 -
C# sring.remove()方法的使用
//函数定义public String Remove(int startIndex);public String Remove(int startIndex, int count); string s1 = "我喜欢的二哈"; //移除从索引1开始到字符串末尾的字符(包括索引1本身) string s2 = s1.R...原创 2019-08-13 13:50:40 · 1551 阅读 · 0 评论 -
C# string中的copy()&&CopyTo()
函数定义:public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count);//sourceIndex 要被复制的字符串的第一个索引//destination 复制到的字符数组//destinationIndex 存放到字符数组的索引//count 所要复制的字符的长度...原创 2019-08-13 15:22:19 · 4741 阅读 · 0 评论