title: Setting String Length Limit then either substring or space filled
body: <p><strong>Scenario</strong>: I'm creating a file thats need to be in this format <a href="https://www.rbcroyalbank.com/ach/file-451771.pdf" rel="nofollow">https://www.rbcroyalbank.com/ach/file-451771.pdf</a> . I need to be able to set the limit of the string length for certain fields.</p>
  
  <p><strong>Question</strong>: Is there an easy way to set the limit of the field so that if the string was larger then the limit then just take the substring and if smaller would add extra spaces?</p>
  
  <p><strong>Note</strong>: I was able to accomplish something similar to this with integers by just using .toString("00000").</p>