0% found this document useful (0 votes)
144 views18 pages

ICT Strings

ICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT Strings

Uploaded by

marco_pangilinan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views18 pages

ICT Strings

ICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT StringsICT Strings

Uploaded by

marco_pangilinan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

STRINGS

WHAT IS A STRING?
A

string is considered as
a sequence or series of
characters and treated as
a single data item.

WHAT ARE STRINGS

Strings

are used in
programs to store
and process text data
manipulation.

BASIC STRING
FUNCTIONS

getch()
a

string input function. The


function reads text from the
keyboard until the Enter Key is
pressed.

Syntax:

gets(string_var);

puts()
a

string output function. This


function displays the string
value (which is stored from the
string variable).
Syntax: puts(string_var);

strlen()
this

function returns
the length of the string.
Syntax: strlen(string);

strcpy()
this

string function copies the


content of string2 to string1. The
str1 and str2 can be a variable
or a string data(value).
Syntax: strcpy(str1, str2);

strcat()
this

string
function
concatenates the strings. It
appends (add/join) string2 to
the end of string1.

Syntax:

strcat(str1, str2);

strlwr()
this

string
function
converts all the uppercase
letter
in
string
to
lowercase.
Syntax: strlwr(str);

strupr()
this

string function converts


all lowercase letter in string
to uppercase.
Syntx: strupr(str);

strrev()
this

string function
reverses all the characters
in the string.
Syntax: strrev(str);

strcmp()
this

string function compares two


strings. If string1 > string 2, the
function returns a positive value; if
string 1 < string 2, the function
returns negative value; if string
1==string2, the function returns a
zero value.

strcmp()
Syntax:

strcmp(str1,str2);

strcmpi()
this

string function compares two strings


and ignore whether an uppercase or
lowercase letter are being compared.
Lowercase and upppercase letters are
treated equal or the same.

Syntax:

strcmpi(str1,str2);

strncpy()this

string function copies


only a portion(size) of
strings into string1.
Syntax: strncpy(str1, str2,
size);

toupper()
this

string function converts an


input lowercase letter into its
uppercase equivalent.

Syntax:

toupper(vletter):

tolower()
this

string function converts


an input uppercase letter into
its lowercase equivalent.

Syntax:

tolower(vletter);

You might also like