There are many methods in every language to truncate text. However, recently, I faced a challenge on the front-end in CSS, where I needed to truncate text for multiple lines. In this case, I wasn't allowed to use the JS function and had to fix it via CSS. Consider this property as the box text handle.
In simple words, when you place the text in any element, the text wrapping in that specific space depends on the width of the element. If the width of the frame is 40 pixels and you added text in it, the text will adjust itself according to the available white space. By default, the blank space in the box is set to normal. Therefore, every text that reaches the 400-pixel limit will be automatically adjusted and changed to the next line.
Here, A1 is the string you use and 6 indicates truncating the string into six characters. If you have Kutools for Excel, a handy tool, you can apply its Delete By Position utility to quickly remove characters that you don't need and truncate the string. Currently, the CSS rule line clamp which truncates text to a certain number of lines is implemented in Safari and Chrome. We can do this using the powerful and standard RIGHT, LEFT and MID text truncation tools easily.