Skip to content

added method TruncateToLength and a test case for the same #1373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ajitpattar708
Copy link

Added truncateToLength, a null-safe method to truncate strings, returning "" for null.

@garydgregory
Copy link
Member

-1 for me: this is almost the same as https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html#substring(int,int)

What do others think?

@ppkarwasz
Copy link

What do others think?

I was thinking about substring too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants