Functions.SubStr2 方法 |
命名空间: XSharp.Core
1LOCAL cName AS STRING 2cName := "Biff Styvesent" 3? Substr2(cName, 6) // Styvesent 4? Substr2(cName, SLen(cName) + 2) // null string
1? FileBase("c:\prg\myfile.obj") // myfile.obj 2FUNCTION FileBase(cFile) 3 LOCAL nPos AS DWORD 4 IF (nPos := RAt("\", cFile)) != 0 5 cFile := Substr2(cFile, nPos + 1) 6 ELSEIF (nPos := At(":", cFile)) != 0 7 cFile := Substr2(cFile, nPos + 1) 8 ENDIF 9 RETURN cFile