Skip to content

Humanize.truncateWords returns null when input has less number of words #84

@KrishnaPG

Description

@KrishnaPG
Humanize.truncateWords("hello world", 2)
null
Humanize.truncateWords("hello world", 1)
"hello ..."

The primary reason one wants to use methods such as truncateWords is if the size increases beyond certain point, truncate it (and leave it untouched if input is smaller in length). Currently the method is returning null if input has less no. of words than requested.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions