This page demistrates the syntax of Arrays as well as their uses.

Code Output

STRINGNAME.append("String");

STRINGNAME.append("String",[first index],[number of postions]);

STRINGNAME.append("String",[last index to add]);

STRINGNAME.append([# times to repeat],'Char');

This function allows the programmer to add more to a string. If it is a interger or another value, it will be converted to a string and appended to the String.

The overloaded funtions will allows the user to add a range of string to another string. This works by the programmign specifying the index he/she would like to start at, then specifying the number of positions to append.

The programmer may also just place the last index of which the user would like to copy to the other string, the copying will automatically start copying at postion 0 when the programmer only puts one index value in.

Finally the programmer may also append a char to a string a certain number of times. For examply the programmer could append T to the string 12 times.

code

STRINGNAME.assign("String");

This function allows the programmer to assign an array of charcters to a another string. This function has the same overloaded functions and syntax as above.

code

STRINGNAME.at([index]);

Returns the charcter at the specified index postion.

code

STRINGNAME.clear();

Removes all characters from the array, once used the array is empty.

code

STRINGNAME.erase([index], [number of chars to erase]);

Erases a specified number of chars in a string from a specified index.

code

STRINGNAME.empty();

Returns 1 (true) if the string is empty, 0 (false) if there are characters in the string.

code

STRINGNAME.length();

STRINGNAME.size();

Returns the number of characters inside of a string as a interger.

code

STRINGNAME.capacity();

Returns the amount of space, as a interger, that has been alocated to the string.

code

STRINGNAME.compare("string2");

Compars two strings and returns 0 if the two strings are the same and if it is less than or greater than 0 the two strings are not the same.

code

STRINGNAME.substring([index],[number postions to move]);

STRINGNAME.substring([index]);

Allows the programmer to split strings based on their needs. The overloaded function allows the programmer to enter only one index, this returns everything from the specififed index to the end of the string. Both return a string for a value.

code

STRINGNAME.find('[char]');

STRINGNAME.find('[char]',[index]);

STRINGNAME.find("[string]");

STRINGNAME.find("[string]",[index]);

Returns the index of the char that matches the char proved by the programmer. The overloaded function allows the programmer to search for a given char starting at a specific index or after that specified index. You are able to do the same thing but with a string, where the function will find the first occurence of the substring and return the index.

code

STRINGNAME.insert([index],"[String]");

STRINGNAME.substring([index],[times to repeat],'[char]');

This function allows the programmer to insert a string into another string by specifying the index where he/she would like the string to be added. The overloaded function of this allows the programmer to repeat a char at a specfic index for a specified number of times.

code

STRINGNAME.replace([index],[number chars to replace],"[String]");

Allows the programmer to replace a specified number of chars from a specified starting index with another sting.

code