C
C#2y ago
turtlesx

masking

How do I specify how many characters I want to mask
23 Replies
turtlesx
turtlesx2y ago
I am unable to use mask on C#
Angius
Angius2y ago
Why are you converting a string to a string? And what do you mean by "mask"?
turtlesx
turtlesx2y ago
basically X out the string
Angius
Angius2y ago
When entering it, or when printing it out?
turtlesx
turtlesx2y ago
printing
Angius
Angius2y 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
turtlesx2y ago
as i want to mask out the front character specified by me\
Angius
Angius2y ago
Joining those strings together would be the last
turtlesx
turtlesx2y ago
like how many char i want to X out
Angius
Angius2y ago
That'd be the n
turtlesx
turtlesx2y ago
I do not understand
Angius
Angius2y ago
turtlesx
turtlesx2y ago
Sry as i am quite new to c#
MODiX
MODiX2y 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
Angius2y ago
This will create a string with 7 *s in it So that's the first part of solving your problem
MODiX
MODiX2y 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
turtlesx2y ago
Cool
Angius
Angius2y ago
This will take only some part of the string So that solves the second part
MODiX
MODiX2y 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
Angius2y ago
And this concatenates two strings together
turtlesx
turtlesx2y ago
like using existing string I want to X it out
Angius
Angius2y 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
turtlesx2y ago
ahhh thx for your help
Want results from more Discord servers?
Add your server
More Posts