1 / 12

Strings!

Strings!. Comp 101. What is a String?. Basically, a sequence of characters Character? Like… a letter Or a number Or even blank space. What is a String?. Anything can be interpreted as a string regardless of format In an expression (formula) string must be inside double quotes!

landen
Download Presentation

Strings!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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

More Related