Replace

Replace:取代字串
Function Replace(Expression As String, Find As String, Replace As String, [Start As Long = 1], [Count As Long = -1], [Compare As VbCompareMethod = vbBinaryCompare]) As String

取代後的字串=Replace(原字串,要被取代的字串,取代成的字串,[開始搜索位置],[取代的次數],[文字比較的模式])

e.g

Dim strtxt As String
strtxt = "hello"
strtxt = Replace(strtxt, "ll", "AA")
Print strtxt 'heAAo


上一頁