码迷,mamicode.com
首页 > Windows程序 > 详细

C#常用方法使用分享

时间:2017-12-12 17:33:04      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:str   取值   split   log   blog   [1]   div   描述   方法   

<一>

方法:Split

描述:分割函数

内容: string str="2017-12-21"

取值: str.Split(‘-‘)[0] :2017

    str.Split(‘-‘)[2] :21

 <二>

  方法: Contains

  描述:检某个字符在当前字符串中是否存在

  内容: string str="2017-12-21"

       取值:if (str.Contains("12"))

{
存在则  str.Split(‘-‘)[1] :12
}

C#常用方法使用分享

标签:str   取值   split   log   blog   [1]   div   描述   方法   

原文地址:http://www.cnblogs.com/PengRay0221/p/8028431.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!