legacy String command

D

Duncan Welch

Hi,

Back in classic ASP, there used to be a string function that generated x
occurances of a given character. Does anyone know the equivalient in
ASP.NET?

Thanks in advance

Dunc

---/ snip /---

' Old ASP function to keep strings all the same length...
Function PadNumber(sNumber, iLength)
If Len(sNumber) >= iLength Then
PadNumber = sNumber
Else
PadNumber = String(iLength - Len(sNumber), "0") & sNumber
End If
End Function
 
R

Ravikanth[MVP]

Hi Dunc,

you can use String.PadLeft and String.PadRight methods to
pad left/right with specified length.

HTH
Ravikanth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top