1、处理带汉字的字符串中长度为奇数,也就是说在字符串的终点有非法单个字符的情况
if Mod ( len(ls_bgqnr), 2)<>0 then
ls_bgqnr=leftw(ls_bgqnr,lenw(ls_bgqnr)- 1)
ls_bghbmmc=leftw(ls_bghbmmc,lenw(ls_bghbmmc)- 1)
end if
本文介绍了一种处理带有汉字的字符串时遇到的问题:当字符串长度为奇数时,末尾可能出现非法单个字符。文章提供了一段代码示例,通过截取字符串来解决这一问题。
if Mod ( len(ls_bgqnr), 2)<>0 then
ls_bgqnr=leftw(ls_bgqnr,lenw(ls_bgqnr)- 1)
ls_bghbmmc=leftw(ls_bghbmmc,lenw(ls_bghbmmc)- 1)
end if

被折叠的 条评论
为什么被折叠?