Category "string-length"

How can I truncate a line of text longer than a given length?

How would you go about removing everything after x number of characters? For example, cut everything after 15 characters and add ... to it. This is an example s

PHP - Check if string contains words longer than 4 characters, then include "+ *", and for those shorter than 4 characters include only "*"

I manage to do partially just one part, but cannot make the second part work. If a word has < 4 characters, only * should be included at the end of that wo

String field value length in mongoDB

The data type of the field is String. I would like to fetch the data where character length of field name is greater than 40. I tried these queries but returni