PB split 字符串拆分函数

$PBExportHeader$split.srf
$PBExportComments$字符串拆分函数
global type split from function_object
end type
 
forward prototypes
global function integer split (string assource, string astag, ref string aaret[])
end prototypes
 
global function integer split (string assource, string astag, ref string aaret[]);//
//  功能:拆分字符串
//  入参:asSource 源串
//       asTag    分隔符
//       aaRet[]  结果列表
//
 
Long i = 0, llPos, llBegin = 1
 
If IsNull(asSource) Then 
	Return 0
End If
 
llPos = Pos(asSource, asTag, llBegin)
Do While llPos > 0
	i ++
	aaRet[i] = Mid(asSource, llBegin, llPos - llBegin)
	llBegin = llPos + Len(asTag)
	llPos = Pos(asSource, asTag, llBegin)
Loop
 
If llBegin <= Len(asSource) Or i > 0 Then
	i ++
	aaRet[i] = Mid(asSource, llBegin, Len(asSource) - llBegin + 1)
End If
 
Return i
 
end function
 

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值