C
C#3y ago
turtlesx

masking

How do I specify how many characters I want to mask
23 Replies
turtlesx
turtlesxOP3y ago
I am unable to use mask on C#
Angius
Angius3y ago
Why are you converting a string to a string? And what do you mean by "mask"?
turtlesx
turtlesxOP3y ago
basically X out the string
Angius
Angius3y ago
When entering it, or when printing it out?
turtlesx
turtlesxOP3y ago
printing
Angius
Angius3y ago
Using the string constructor to create a string with n letters X in it would be one part of it Cutting out the first n characters of your string would be the second
turtlesx
turtlesxOP3y ago
as i want to mask out the front character specified by me\
Angius
Angius3y ago
Joining those strings together would be the last
turtlesx
turtlesxOP3y ago
like how many char i want to X out
Angius
Angius3y ago
That'd be the n
turtlesx
turtlesxOP3y ago
I do not understand
Angius
Angius3y ago
turtlesx
turtlesxOP3y ago
Sry as i am quite new to c#
MODiX
MODiX3y ago
Angius#1586
REPL Result: Success
new String('*', 7)
new String('*', 7)
Result: string
*******
*******
Compile: 258.640ms | Execution: 16.901ms | React with ❌ to remove this embed.
Angius
Angius3y ago
This will create a string with 7 *s in it So that's the first part of solving your problem
MODiX
MODiX3y ago
Angius#1586
REPL Result: Success
"hello world"[4..]
"hello world"[4..]
Result: string
o world
o world
Compile: 389.564ms | Execution: 50.514ms | React with ❌ to remove this embed.
turtlesx
turtlesxOP3y ago
Cool
Angius
Angius3y ago
This will take only some part of the string So that solves the second part
MODiX
MODiX3y ago
Angius#1586
REPL Result: Success
"hello " + "world"
"hello " + "world"
Result: string
hello world
hello world
Compile: 280.447ms | Execution: 21.267ms | React with ❌ to remove this embed.
Angius
Angius3y ago
And this concatenates two strings together
turtlesx
turtlesxOP3y ago
like using existing string I want to X it out
Angius
Angius3y ago
Cool I know I gave you the solution, now it's on you to implement it If you're expecting to be spoonfed a ready-made solution, I have bad news for you
turtlesx
turtlesxOP3y ago
ahhh thx for your help
Want results from more Discord servers?
Add your server