iT邦幫忙

DAY 25
2

我的.Net之路系列 第 25

搜尋字串

幾個和String類別有關的方法
(1) String.Contains 方法 : 可找出字串A是否包含字串B
http://msdn.microsoft.com/zh-tw/library/dy85x1sa.aspx
ex:

    Dim  A as String="This is a book"
    Dim B as String="book"
    Dim C as Boolean
    C=A.Contains(B)

(2) Strin.IndexOf方法:找出這個字串中 String 或一個或多個字元之第一個符合項目的索引 (有九個多載)
http://msdn.microsoft.com/zh-tw/library/system.string.indexof.aspx
ex:

 Dim  A as String="This is a book"
 Dim B as String="book"
 Dim C as Integer
 C=A.IndexOf(B,0) 

上一篇
BackGroundWorker的參數傳遞
下一篇
二進位與大型資料的儲存
系列文
我的.Net之路31
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言