We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Unicode
1 parent 7e14c67 commit d34ca79Copy full SHA for d34ca79
1 file changed
twinkle-ansi/src/main/java/org/codejive/twinkle/util/Unicode.java
@@ -0,0 +1,13 @@
1
+package org.codejive.twinkle.util;
2
+
3
+public class Unicode {
4
+ public static int visibleWidth(CharSequence text) {
5
+ int width = 0;
6
+ SequenceIterator si = SequenceIterator.of(text);
7
+ while (si.hasNext()) {
8
+ si.next();
9
+ width += si.width();
10
+ }
11
+ return width;
12
13
+}
0 commit comments