Text string, width or number of characters

Any ideas how to get a text string to fill a particular width i.e. with a specific character until it reaches the specified width or number of characters?