Limit length in Variable Text

Hi,

So for my Dashboard, I have an Variable in which notifications will be added to the existing variable.
In short: If a Notification is made - then edit “TextVar” to " Notification \n TextVar"
So it’ll add the notification to the TextVar.

My Question:
How do I limit the text in this Variable?
Is there a code to limit it to 100 characters?
Or does it automatically skip the last piece of TextVar at a surtain limit?

I don’t want this variable to explode in time and I want to limit the recources needed by the dashboard.