case 1:
i = 1
Do While myFName <> ""
i = i + 1
Cells(i, 1) = myFName '原本是abced.mp3
Cells(i, 1) = Left(myFName, Len(myFName) - 4) '把.mp3分割去掉
myFName = Dir()
Loop
http://www.scjh.tpc.edu.tw/teacher/ccqa/vbscript/%E5%AD%97%E4%B8%B2%E5%87%BD%E6%95%B8.htm
或者用:
Cells(i,1) = myFSO.GetBaseName(myFName) 'GetBaseNmae傳回去掉副檔名
case 2:
substitute(text,old_text,new_text,instance_num)原本字串儲存格裡面,如有含old_text舊字串將會被new_text新字串所取代
例如:原本字串text=" ab c e f ",舊字串=" "取代新字串"",substitute(text,old_text,new_text)字串"abcef"
case 3:
trim(text)刪除多餘空白文字資料,但是字與字之間所保留的"單一空白"留著
例如一:原本字串text=" ab c e f ",trim(text)字串"ab c e f"
例如二:原本字串text=" ab c e f ",trim(text)字串"ab c e f"