vbstrings - CIS 338: Handling Strings Dr. Ralph D. Westfall...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 338: Handling Strings Dr. Ralph D. Westfall January, 2009
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What Is a String? series of characters enclosed in double quotes characters can include letters (lower case and upper case), digits, special characters (spaces, punctuation marks, mathematical operators, "escape sequences," etc.) "Kim" "137 Flower St." "sam@sam.com" "$#,##0;;\Z\e\r\o" 'format string
Background image of page 2
Strings in Memory memory is allocated (reserved) when a string is created a string's memory location is the address of the first byte followed by bytes to tell length of string each .NET character is stored in 2 bytes (Unicode) "A" is stored in 2 bytes: 00 41 (hex)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Strings in Memory - 2 each character in a string is identified by an offset from its memory location 1 st character is at address of string offset = 0 2 nd character is at string address + 1 x 2 (index * offset size) offset = 2 bytes (Unicode) 3 rd is at string address + 2 * 2, etc.
Background image of page 4
String Class a string is actually a class in VB unlike other classes, don't have to use New when creating a string Dim yourName as String = "Viji" strings (literals or as variables) can be connected to properties and methods via "dot notation" like other objects
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
String Properties String.Length intSize = myEmail.Length String.Chars(intI) Dim strName as String = "J Lo" Dim strSpace as String strSpace = strName.Chars(1) 'zero base
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 22

vbstrings - CIS 338: Handling Strings Dr. Ralph D. Westfall...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online