String.PadLeft is a method in C#, which returns a new string of a specified length in which the beginning of the current string is padded with spaces or with a specified Unicode character.
Questions tagged [padleft]
23 questions
0
votes
3 answers
PadLeft and PadRight using variables given in by user
I have a small problem using PadLeft and PadRight.
So I have in my code that the user can input the character they want to use for padding and how many characters they wanna put in. Like this:
String StartString;
int AmountOfCharacters;
Char…

Blasje
- 37
- 1
- 1
- 4
0
votes
1 answer
I cannot display Logs in a Textbox aligned
I am creating log files for my application. When I display the Logs in a Textbox, they dont look aligned even though there are same amount of characters. I use PadLeft function to align everyline but doesnt when I try to display them in textbox. But…

Arif YILMAZ
- 5,754
- 26
- 104
- 189
0
votes
1 answer
Constructor Formatting c# - PadLeft Property of Class
Is there a better way to do what is done in the code that follows? I added a PadLeft in the constructor because I need the leading zero and 10 characters. The leading zero is stripped off, for some reason, in my call to the API that returns the…

chuck
- 57
- 1
- 6
0
votes
2 answers
Comport Reading and Padding
Hello all. I hope someone may be able to help me with two problems I have that I do not understand.
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
// If the com port has been closed, do nothing
if…

quatre432
- 47
- 1
- 11
0
votes
2 answers
.NET My.Computer.Network.Ping & PadLeft
Following code snippet throws an error when padding the last part with 0, and the last part is 008, 009, 018, 019, 028, 029 etc.
Anyone got an idea why?
Sub Main()
Dim fixed As String = "192.168.0."
Dim ip1, ip2 As String
For i As Int32…

Stijn
- 71
- 1
- 1
- 3
0
votes
1 answer
Variable inside Array() is undefined
I'm having a problem with an undefined variable error. This is my code:
window.sys.Bash = {};
window.sys.Bash.version = "";
window.sys.Bash.version.major = 0;
window.sys.Bash.version.minor = 1;
window.sys.Bash.version.build =…

m93a
- 8,866
- 9
- 40
- 58
0
votes
3 answers
control spaces? in a note of products
well i have a printer, and i print their prices
as it
4 $297.41$297.41$892.24
11 $135 $135 $1350
5 $211.2 $0$1056.03
4 $211.2 $211.2$633.62
3 $318.96$206.89 $750
1 $172.41 $0$172.41
2 …

angel uc
- 279
- 2
- 8
- 21
0
votes
11 answers
Can't figure out what this SubString.PadLeft is doing
In this code I am debugging, I have this code snipit:
ddlExpYear.SelectedItem.Value.Substring(2).PadLeft(2, '0');
What does this return? I really can't run this too much as it is part of a live credit card application. The DropDownList as you could…

Mike Wills
- 20,959
- 28
- 93
- 149