'how to make space in c# string for power bi

i use microsoft power bi to generate reports for my business, and i use the matrix visual, and i want to make all columns the same width so  i add a line break after every 25 characters in my c# app,but i don't want to break a word, so if when i add a new word to the line.the line will be greater from 25 characters i make the line break before this word , so some columns have only  lines that is max 23 characters  and some 22 characters, so not all columns have the same width, so i try to add whitespace to the end of the line to be the size of 25 characters with mystring.PadLeft(10) but it's not working in power bi trim it,
(i can't use the setting to not auto-size-width of the columns, because my columns headers are not static)

if anyone have a idea how to solve it 



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source