Download
strings n.
Skip this Video
Loading SlideShow in 5 Seconds..
Strings! PowerPoint Presentation

Strings!

153 Vues Download Presentation
Télécharger la présentation

Strings!

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Strings! Comp 101

  2. What is a String? • Basically, a sequence of characters • Character? • Like… a letter • Or a number • Or even blank space

  3. What is a String? • Anything can be interpreted as a string regardless of format • In an expression (formula) string must be inside double quotes! • “this is a string” and this is not a string. • Remember to beware cut and paste

  4. Referencing characters Each character has a position

  5. Substring • A substring is also a String • A substring is a part of another string • “cake” is a substring of “birthday cake” • so are “day”, “thd”, and “y cake” • “they” is not, neither is “hello” or “dude”

  6. Selecting substrings LEFT – leftmost characters RIGHT – rightmost characters MID – characters in the middle Exercise

  7. Length: LEN Finds the length of a String One of the most important functions Relationship between length and position?

  8. Processing Strings • Operations on Strings such as: • Searching • Replacing • Concatenating • Converting

  9. How? • Click the function button • Select Text • They actually mean String, but whatever • List of handy functions and other goodies

  10. Searching • Find – case sensitive search • Cake ≠ cake • Search – non-case sensitive search • Cake = cake • Example: • Look for UNC

  11. Concatenating • Huh? • It means combining two or more things into one thing • & Anything can be concatenated • “awe” & “some” = “awesome” • Whitespace only matters inside quotes • “a”&“b” same as “a” & “b” • “a ” & “b” NOT the same as “a” & “b”

  12. CONCATENATE Function • Also a function called concatenate • Same thing as & • Can use either • Same as SUM or + • Exercise: • Concatenate two names and a blank or comma