Net very smalltalk like model primitive types are

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ved as "magic" or "special" There is no primitive-type magic in .NET! Very Smalltalk-like model "Primitive" types are regular framework types Still exposed as language-intrinsic types C#: bool, int, long, string, double, float... Visual Basic.NET: Boolean, Integer, String... "Primitives" are mostly value-types Exception: System.String is reference type "Primitive" Types are not so primitive anymore Full-featured classes, rich functionality System Namespace System.String System.String is the cross-language string One storage method, one API, unified handling Locale-aware, always Unicode String is immutable Methods that appear to modify a String actually construct a new one Use String.Format or StringBuilder class instead of string concatenation 9 System Namespace System.String Fully featured string-handling capabilities Forward and reverse substring searches IndexOf(), LastIndexOf(), StartsWith(), EndsWith() Whitespace stripping and padding Trim(), PadLeft(), PadRight() Range manipulation and extraction Insert(), Remove(), Replace(), Substring(), Join(), Split() Character casing and ad...
View Full Document

Ask a homework question - tutors are online