1. You need a SHORT small sub to do that. No need to get bothered...
2. you could use the library stringfunctions https://www.b4x.com/android/help/stringfunctions.html
i guess "PAD" is the method you are searching. Note that stringfunctions is nothing more than a class (or a simple code module) with different subs to do things. all of them are written in B4A.
All of them can be done without a lib (small helper sub as i wrote above).
a/ if doing repetitive string concatenations, use StringBuilder (built-in, no library required, more efficient and quicker than &)
b/ StringFunctions library has function Replicate that seems to do precisely what you originally described
I would not want to use this library, which according to several posts, is out of maintenance, and whose main functions are included in the Core. However, I found a substitute module (StringFunctions2) in case I need anything else.
Thank You.