修改char utils 带圈字符串的注释

This commit is contained in:
duandazhi 2021-04-02 13:24:16 +08:00
parent 72119484ba
commit 6d9766effd

View File

@ -375,6 +375,22 @@ public class CharUtil {
* 'a' - 'ⓐ' * 'a' - 'ⓐ'
* </pre> * </pre>
* *
* 获取带圈数字 /封闭式字母数字 从1-20,超过1-20报错
* 0 1 2 3 4 5 6 7 8 9 A B C D E F
* U+246x
* U+247x
* U+248x
* U+249x
* U+24Ax
* U+24Bx
* U+24Cx
* U+24Dx
* U+24Ex
* U+24Fx
* @link Unicode_symbols https://en.wikipedia.org/wiki/List_of_Unicode_characters#Unicode_symbols
* @link Enclosed Alphanumerics https://en.wikipedia.org/wiki/Enclosed_Alphanumerics
* 有其他特殊的需求可以到 维基百科 查找说明
*
* @param c 被转换的字符如果字符不支持转换返回原字符 * @param c 被转换的字符如果字符不支持转换返回原字符
* @return 转换后的字符 * @return 转换后的字符
* @since 5.6.2 * @since 5.6.2
@ -399,14 +415,15 @@ public class CharUtil {
* 20 - '⑳' * 20 - '⑳'
* </pre> * </pre>
* 也称作封闭式字符英文Enclosed Alphanumerics * 也称作封闭式字符英文Enclosed Alphanumerics
* 维基百科wikipedia-Unicode_symbols https://en.wikipedia.org/wiki/List_of_Unicode_characters#Unicode_symbols * @author dazer
* 维基百科wikipedia-Unicode字符列表 https://zh.wikipedia.org/wiki/Unicode%E5%AD%97%E7%AC%A6%E5%88%97%E8%A1%A8
* coolsymbol https://coolsymbol.com/
* 百度百科 https://baike.baidu.com/item/%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6/112715?fr=aladdin
*
* @param number 被转换的数字 * @param number 被转换的数字
* @return 转换后的字符 * @return 转换后的字符
* @since 5.6.2 * @since 5.6.2
*
* @link 维基百科wikipedia-Unicode_symbols https://en.wikipedia.org/wiki/List_of_Unicode_characters#Unicode_symbols
* @link 维基百科wikipedia-Unicode字符列表 https://zh.wikipedia.org/wiki/Unicode%E5%AD%97%E7%AC%A6%E5%88%97%E8%A1%A8
* @link coolsymbol https://coolsymbol.com/
* @link 百度百科 https://baike.baidu.com/item/%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6/112715?fr=aladdin
*/ */
public static char toCloseByNumber(int number){ public static char toCloseByNumber(int number){
if(number > 20){ if(number > 20){
@ -414,4 +431,14 @@ public class CharUtil {
} }
return (char) ('①' + number - 1); return (char) ('①' + number - 1);
} }
/**
* 获取带圈字符
* Enclosed Alphanumerics
* @since 5.6.3
* @see CharUtil#toEnclosedAlphanumericsCircleByInt(int)
*/
public static char toEnclosedAlphanumericsCircleByInt(int number){
return CharUtil.toCloseByNumber(number);
}
} }