Heisenberg
Heisenberg
Explore posts from servers
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
oh
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
how actually this help?
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
string Hello_Modd = Hello_Mod.PadRight(Hello_Mod.Length + padding,'#');
string Hello_Modd = Hello_Mod.PadRight(Hello_Mod.Length + padding,'#');
about this line
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
Ahh can i ask something?
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
Thank you so much <3
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
oh
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
what does it do?
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
using System;

class Program{
static void Main(){
string Hello = " Hello, World ";
int padding = (Console.WindowWidth - Hello.Length) / 2;
string Hello_Mod = Hello.PadLeft(Hello.Length + padding,'#');
string Hello_Modd = Hello_Mod.PadRight(Hello.Length + padding,'#');
Console.WriteLine(Hello_Modd);
Console.WriteLine(padding);
Console.WriteLine(Console.WindowWidth);
Console.WriteLine(Hello.Length);
Console.WriteLine(Console.WindowWidth / 2);
}
}
using System;

class Program{
static void Main(){
string Hello = " Hello, World ";
int padding = (Console.WindowWidth - Hello.Length) / 2;
string Hello_Mod = Hello.PadLeft(Hello.Length + padding,'#');
string Hello_Modd = Hello_Mod.PadRight(Hello.Length + padding,'#');
Console.WriteLine(Hello_Modd);
Console.WriteLine(padding);
Console.WriteLine(Console.WindowWidth);
Console.WriteLine(Hello.Length);
Console.WriteLine(Console.WindowWidth / 2);
}
}
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
but it only pads from one side
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
Code i gave automatically find amount to chars to pad from both side to center main string
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
?
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
i kinda think it may give same output as last time?
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
ig
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
its just an console app XD
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
nvm
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
oh
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
isnt first parameter int?
72 replies
CC#
Created by Heisenberg on 5/13/2023 in #help
❔ Padding string from two sides
wait u can use leftPadded() as first parameters of PadRight()?
72 replies