正在显示
1 个修改的文件
包含
5 行增加
和
3 行删除
| @@ -207,9 +207,11 @@ public class CommonTest { | @@ -207,9 +207,11 @@ public class CommonTest { | ||
| 207 | @Test | 207 | @Test |
| 208 | public void emoji2(){ | 208 | public void emoji2(){ |
| 209 | String emostring ="😂"; | 209 | String emostring ="😂"; |
| 210 | - System.out.println(emostring.length()); | ||
| 211 | - System.out.println(new StringBuilder().appendCodePoint( | ||
| 212 | - emostring.codePointAt(emostring.offsetByCodePoints(0, 1))).toString()); | 210 | + |
| 211 | + String face_with_tears_of_joy = emostring.replaceAll("\uD83D\uDE02", "face with tears of joy"); | ||
| 212 | + System.out.println(face_with_tears_of_joy); | ||
| 213 | + | ||
| 214 | + System.out.println("======" + face_with_tears_of_joy.replaceAll("face with tears of joy","\uD83D\uDE02")); | ||
| 213 | } | 215 | } |
| 214 | 216 | ||
| 215 | } | 217 | } |
-
请 注册 或 登录 后发表评论