Upgrading to new-style Strings: Difference between revisions
Jump to navigation
Jump to search
Upgrading to new-style Strings (view source)
Revision as of 19:33, 10 February 2010
, 10 February 2010→StrComp -> String.CompareTo: Bad logic is bad man.
*>Monkey 05 06 m (→categoriz'd!) |
*>Monkey 05 06 (→StrComp -> String.CompareTo: Bad logic is bad man.) |
||
Line 75: | Line 75: | ||
String new_Str = "dog"; | String new_Str = "dog"; | ||
Display("%d", new_Str == "DoG"); // displays | Display("%d", new_Str == "DoG"); // displays ZERO | ||
Also note that the comparison operators return a boolean value unlike the comparison functions. The reason ''new_Str == "DoG"'' displays zero is because the comparison returns '''false''' which evaluates as zero numerically. This is important because this is essentially the opposite of StrComp and String.CompareTo. | |||
===StrContains -> String.Contains=== | ===StrContains -> String.Contains=== |