Splitter.fixedLength support for codepoints
See original GitHub issueCurrently Splitter.fixedLength
splits strings based on chars. It would be nice if the splitter had a configurable encoding, such as utf-8, for codepoints.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Splitter fixedLength() method | Guava | Java - GeeksforGeeks
The method fixedLength(int length) returns a splitter that divides strings into pieces of the given length. For example, Splitter.
Read more >Split string to equal length substrings in Java - Stack Overflow
@Emil: If you want a one-liner for splitting the string, I'd recommend Guava's Splitter.fixedLength(4) as suggested by seanizer. – ColinD. Sep ...
Read more >Guava's String Helpers – Joiner, Splitter, CharMatcher and ...
This article help to understand and best use of Guava's string helper classes, Joiner, Splitter, CharMatcher and Charsets.
Read more >Splitter (Guava: Google Core Libraries for Java 19.0 API)
Consequently, all splitters split the empty string to [""] (note: even fixed-length splitters). Splitter instances are thread-safe immutable, and are therefore ...
Read more >How to Truncate a String in Java - Baeldung
We used Splitter.fixedLength() to split our String into multiple pieces of the given length. Then, we returned the first element of the result....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d strongly argue for it to be based on extended grapheme clusters rather than code points, if at all technically feasible. But other than that, I agree. 😃
Are there any contexts in which splitting on code points would be preferable to splitting on grapheme clusters?