The string datatype is used to store a series of ansii characters.
The characters stored on a string can be any letter, number or
special character. Sometimes characters have special uses outside
of the string datatype and need a \ before them so the string will
accept them. See the section for EXCEPTIONS later in this coding
file for details.

%^MAGENTA%^%^BOLD%^%^MAGENTA%^%^BOLD%^-----< Declaring String Data Types >-----

string my_name;

This line declares a variable of the string datatype called my_name.
Please remember that variables must be declared before they can be
used.

%^MAGENTA%^%^BOLD%^-----< Assigning a value to a string >-----

my_name = "ironman";

This line used the operator = to assign the value "ironman" to the
string variable called my_name. There are several operators that can
be used to manipulate variables. Please see %^CYAN%^%^BOLD%^coding operators%^RESET%^ for more
information on all the operators. Notice that the string is encased
in "". The "s are used by the compiler to denote strings.

%^MAGENTA%^%^BOLD%^-----< Adding and subtracting strings >-----

my_name = "ironman";
intro = "My name is ";

report = intro + my_name;

This snippet of code assigns the values to my_name and intro. It then
adds them together to get the following sentence contained in report;

       "My name is ironman"

You may also subtract strings from one another as well.

%^MAGENTA%^%^BOLD%^-----< Declaring AND defining strings together >-----

string my_name="ironman";
string my_class="pyromancer";
string my_race="elf";

All variable types can be defined right when you declare them. I find
it very handy and compact to do this. The drawback to coding this way
is you have to know what you want your code to be doing ahead of time.
it makes it hard to manipulate to code later if you are defining your
variables at declaration.

%^RED%^%^BOLD%^SPECIAL NOTE :::::

You may also use the conditonal operator in the declaration statements.
Please don't attempt this until you are comfortable with using the ?:
statements. See %^CYAN%^%^BOLD%^coding logical_switches%^RESET%^ for more information.

%^MAGENTA%^%^BOLD%^-----< Indexing strings >-----

Most coders who do not know c++ do not realize that the string datatype
is really an array of another type called "character". Character is not
used in the LPC language but it's affects can be seen in the string type.

Since the string type is an array, it can be indexed like an array.

string sample="I'm a sexy wombat from Texas."
string report;

Above I have declared and defined the varaible called sample. We may now
index the string i have stored in the variable. Report is going to be
used to store the results of each indexing.

report = sample[0 .. 9];

      Report would equal "I'm a sexy".

report = sample[0 .. <1];

      Report would equal "I'm a sexy wombat from Texas."

report = sample[<10 .. <1];

      Report would equal "from Texas."

Please see the %^CYAN%^%^BOLD%^coding indexing%^RESET%^ for more details about indexing.

%^RED%^%^BOLD%^SPECIAL NOTE :::::

You do NOT need to do a sizeof() on your strings to get the whole string
into a variable. All you need to do is index the variable with [0 .. <1].
This indexing basically tells the processor to return from the first
character to the last character on the indexed string.

%^MAGENTA%^%^BOLD%^------< Character Exceptions >------

There are several characters that hold special meaning outside of
strings. As such, they sometimes lead to syntax errors if you put them
inside of a strings' "s. If this happens, Try putting a / infront of
the character. The following are a few examples of things that need
a / infront of them;

      /         "        (      )

There are others as well. If your code returns a syntax error and the
string looks fine, You may have one of these characters in the string.
Try putting a / in front of the character to fix it.


======================================================================

Ironman

