question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Splitter.fixedLength support for codepoints

See original GitHub issue

Currently 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:open
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jbduncancommented, May 30, 2019

A believe a fluent soln by code point would be useful:

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. 😃

0reactions
lowassercommented, May 30, 2019

Are there any contexts in which splitting on code points would be preferable to splitting on grapheme clusters?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found