473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

legacy String command

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
Nov 17 '05 #1
1 1375
Hi Dunc,

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

HTH
Ravikanth

-----Original Message-----
Hi,

Back in classic ASP, there used to be a string function that generated xoccurances of a given character. Does anyone know the equivalient inASP.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
.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Max Christian | last post by:
I'm writing a mixed-mode C++ DLL which is used by an old C++ application that I don't have the source code to. I'm amazed by the ease of interoperability, but the one problem I'm having is...
3
by: Geoff | last post by:
I need to keep a few VB6 tcpClients active, but have them talk to a dotNet tcpServer/tcpListener. The "Server"/Listener is running as a Plugin, and needs to respond to "outside requests". The...
1
by: gregory_may | last post by:
I have a mixed ASP.NET and legacy ASP application. Right now, the .ASP pages use a mix of Hard Coded connection strings and an "Global Included" file. I would like to use the connection string...
0
by: John Olbert | last post by:
I am trying to understand how legacy controls (for example, those created with Visual Studio C++ 6.0) work in Vs2005. I have run into some problems. The legacy control is MfcAxc1.ocx. After...
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
2
by: Ben | last post by:
I'm left with some legacy code using plain old str, and I need to make sure it works with unicode input/output. I have a simple plan to do this: - Run the code with "python -U" so all the string...
11
by: briankirkpatrick | last post by:
Forgive me if my post seems a little amateurish... I'm requesting assistance from some of you smart folks out there to get the managed calls write that meet the specification in the esa.h for...
1
by: Subodh | last post by:
Hi, We have legacy code in C/C++, I am writing a wrapper component in C++/ CLI that will allow using this legacy code functionality in C#, I have linked all my static libraries to this C++/CLI...
0
by: SvenV | last post by:
Hello, I'm quite new to WCF and want to use it in a project that I'm currently working on. I need some advice though. The legacy application that I currently have created an xml file with data....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.