本文主要是介绍LotusScript下的 @Explode 函数(把字符串分隔成数组的函数),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
LotusScript的函数如下:
Function Explode(Byval sInput As String, ByVal sDelimiter As String) As Variant Dim sOutput As String Dim aOutput() As String Dim nPos As Integer Dim nNextPos As Integer sOutput = sInput Redim aOutput(0) nPos = Instr(sOutput, sDelimiter) While nPos <> 0 aOutput(Ubound(aOutput)) = Left(sOutput, nPos - 1) sOutput = Right(sOutput, Len(sOutput) - Len(sDelimiter) - nPos + 1) nPos = Instr(sOutput, sDelimiter) Redim Preserve aOutput(Ubound(aOutput) + 1) Wend aOutput(Ubound(aOutput)) = sOutput Explode = aOutput End Function |
使用范例
vList = Explode("Item 1,Item 2,Item 3", ",") |
这篇关于LotusScript下的 @Explode 函数(把字符串分隔成数组的函数)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!