Formatting Strings

  • "Hi" & myFirstName & ", you won 100 €." OR Format("Hi {0}, you won 100 €.", myFirstName) [both versions concatenate strings and a string variable]
  • Format("The code is: {0:00_000-0}", 8767523) [formatting an integer, returns: The code is: 87_675-23]
  • Format("The watch costs {0:0.00} Euro", 199.77777) [formatting an integer, returns: The watch costs 19.78 Euro]
  • ToString("dd.MM.yyyy") [converts a DateTime object to a string formatted as a date]
Was this article helpful?
0 out of 0 found this helpful