public RangeInt selection ;

Description

获取或设置目前正在编辑的字符串中的所选文本的字符范围。

For example: if the keyboard is editing a text "abcdef" and the "cde" substring is selected, the return value is a RangeInt with the RangeInt.start value set to 2 and a RangeInt.length value of 3. Similarly, setting selection to a RangeInt with the RangeInt.start value set to 2 and a RangeInt.length value of 3 will select "cde" of the string "abcdef".

如果光标介于两个字符之间并且没有选择文本,则 RangeInt.length 属性为 0。

如果 canGetSelection 为 false,这将始终返回一个空范围(从 0 开始,长度为 0)。