Formatting inconsistencies

cjard

Well-known member
Joined
Apr 25, 2006
Messages
7,081
Programming Experience
10+
In another thread I raised that point that i format a string like this:
VB.NET:
String.Format("the number is {0}", myNumber)


but I format a date like this:
VB.NET:
myDate.ToString("yyyy MM dd")



Can i format a number like that too?
VB.NET:
myNumber.ToString("the number is ... ????")



Is there a resolution to this inconsistency?
 
Last edited by a moderator:
There's no inconsistancy here. The differences are clear....One uses the format class the others dont. The output of your examples are a string so why would you not want to use string.format?
 
Back
Top