切字符串并获取字符数 [英] cut string and get character count
本文介绍了切字符串并获取字符数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获取字符串的字符数,这样我就可以做到:
I want to get the character count of a string so I can do:
If charactercount(newbutton.text)>27 Then
'also shorten/cut the string
shortenedstring & "..."
End If
推荐答案
尝试一下:
If newbutton.text.length>27 Then
'also shorten/cut the string
shortenedstring = newbutton.text.substring(0, [length]) & "..."
End If
这篇关于切字符串并获取字符数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文