Article Preview
Buy Now
| Print: | |
| PDF: |
Beginner's Corner
String Theory
Working with strings
Issue: 3.5 (May/June 2005)
Author: Marc Zeedar
editor-at-rbdeveloper.com
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 13,450
Starting Page Number: 30
RBD Number: 3512
Resource File(s):
3512.sit Updated: Wednesday, May 18, 2005 at 11:40 AM
3512.zip Updated: Wednesday, May 18, 2005 at 11:40 AM
Related Web Link(s):
http://www.rbdeveloper.com/browse/1.1/1005/
Known Limitations: None
Excerpt of article text...
Perhaps it's because I'm a writer and fascinated by text, but strings have always been my favorite data structure. Unlike more abstract data structures like arrays or classes, strings usually contain human-understandable data. They don't have to, of course -- you can store any kind of data you'd like in a string (even a picture) -- but for the most part, strings contain text you want to manipulate. That makes strings a little easier for the beginner to get a handle on. However, strings are so basic that they are rarely discussed. Often, the beginner is afraid to ask obvious questions and thus stumbles blindly. So here's a little refresher course in string manipulation.
The Basics
REALbasic provides many powerful string routines. Most are similar to those in other languages and their functions are fairly evident. For example, the len function returns the number of characters in a string.
Two very useful functions are left and right, which return a portion of a string starting from either the left or the right side. For instance, right("hello", 3) returns "llo" -- the three rightmost characters.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|










