function str1(str0 as string) as string
'功能:将拼音声调字符转换为字母
str1=str0
str1=Replace(Replace(Replace(Replace(str1,"ā","a"),"á","a"),"ǎ","a"),"à","a")
str1=Replace(Replace(Replace(Replace(str1,"ē","e"),"é","e"),"ě","e"),"è","e")
str1=Replace(Replace(Replace(Replace(str1,"ī","i"),"í","i"),"ǐ","i"),"ì","i")
str1=Replace(Replace(Replace(Replace(str1,"ō","o"),"ó","o"),"ǒ","o"),"ò","o")
str1=Replace(Replace(Replace(Replace(str1,"ū","u"),"ú","u"),"ǔ","u"),"ù","u")
str1=Replace(Replace(Replace(Replace(str1,"ǖ","v"),"ǘ","v"),"ǚ","v"),"ǜ","v")
end function
function str1(str0 as string,B as boolean) as string
'功能:将阿拉伯数转换为中文字符
'参数:B=true 转换为一、二... B=False 转换为壹、贰...
str1=str0
select case B
case true
str1=Replace(Replace(Replace(Replace(str1,"0","0"),"1","一"),"2","二"),"3","三")
str1=Replace(Replace(Replace(Replace(str1,"4","四"),"5","五"),"6","六"),"7","七")
str1=Replace(Replace(str1,"8","八"),"9","九")
case false
str1=Replace(Replace(Replace(Replace(str1,"0","零"),"1","壹"),"2","贰"),"3","叁")
str1=Replace(Replace(Replace(Replace(str1,"4","肆"),"5","伍"),"6","陆"),"7","柒")
str1=Replace(Replace(str1,"8","捌"),"9","玖")
end select
end function
假如你认为运算符输出不美观,也可以用这个方法来编写一个自定义的转换函数:
function str1(str0 as string) as string
'功能:将运算符转换为输出格式
str1=str0
str1=Replace(Replace(Replace(Replace(str1,"+","+"),"-","-"),"*","×"),"/","÷")
str1=Replace(Replace(Replace(Replace(str1,"=","="),"<>","≠"),"<=","≤"),">=","≥")
str1=Replace(Replace(str1,"<","<"),">",">")
end function