ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

 

Code Snippets

  

ASP Source Code


Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 300,341 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,608 people online right now. Registration is fast and FREE... Join Now!





LeftPad

Left pads the input string to the desired length with the given padding character

Submitted By: Chubber
Actions:
Rating:
Views: 1,629

Language: ASP

Last Modified: June 12, 2007

Snippet


  1. Function LeftPad(strIn, strPad, iLen)
  2.      'Left pads the input string to the desired length with the given padding character
  3.      'Does not truncate
  4.      If Len(strIn) < iLen Then
  5.           LeftPad = String((iLen - Len(strIn)), strPad) & strIn
  6.      Else
  7.           LeftPad = strIn
  8.      End If
  9. End Function

Copy & Paste


Comments


Trogdor 2008-05-29 08:33:36

carefull to only work with single character padding.


Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month