Generally speaking, a string is anything that you can type using the keyboard, including letters, symbols (such as &, *, and @), and digits. Sometimes a program deals with data that comes in the form of strings (text). In PHP, Java, C++, C#, Visual Basic, and Python, a string is always enclosed in double quotes like this:  “      ”.

Notice: Even though PHP and Python permits strings to be enclosed in single quotes as well, this website prefers the use of double quotes.

Each statement in the next example outputs a string.

PHP

Java

C++

C#

Visual Basic

Python

Strings are everywhere—from word processors, to web browsers, to text messaging programs. Many exercises in this website actually make extensive use of strings.

If you need more information you can visit

Notice:String functions can be used when there is a need, for example, to isolate a number of characters from a string, to remove spaces that might exist at the beginning of it, or to convert all of its characters to uppercase.

Remember! Functions (or methods) are nothing more than small subprograms that solve small problems. A subprogram can be defined as a block of statements packaged as a unit that has a name and performs a specific task.

Leave a Reply

Your email address will not be published. Required fields are marked *

This article is taken from a book of mine. If you enjoyed it, please visit my author's page inand check out all of my books!