akohan
asked on
How to replicate a character
Hello group,
Unfortunately I'm not a VB.net developer but I am reviewing somebody's code where has something like:
WriteAllText("file_name", " **************************
Is there a better way to replicate the * character like replicate or duplicate("*") as argument in the function.
Thanks,
ak
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
...and another one:
Dim stars As New String("*", 32)
MessageBox.Show(stars)
Dim stars As New String("*", 32)
MessageBox.Show(stars)
ASKER
May I ask what is the small "c" character at the end of "*" ?
like "*"c
Thanks.
That converts the String "*" to a Char.
It's not actually necessary for this function as it accepts "any valid Char, String, or Object expression."
It's really on necessary when "Option Strict" is on....since otherwise the implicit conversion is done for you. You see it more often in C# where the default typecasting is more strict and it's required.
It's not actually necessary for this function as it accepts "any valid Char, String, or Object expression."
It's really on necessary when "Option Strict" is on....since otherwise the implicit conversion is done for you. You see it more often in C# where the default typecasting is more strict and it's required.
ASKER
Thank you!
ASKER
Thanks to all.
Open in new window