Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
32.8k views
in Computer by (52.7k points)

Explain five string handling functions with syntax and examples. 

1 Answer

+2 votes
by (46.7k points)
selected by
 
Best answer

1. Strlen( ) function:

It calculates the length of the given string and returns the number of characters in a string.

Syntax: integer variable = strlen(string);

Ex: length = strlen(“Bharath”);

Output : 7

2. Strcat() Function:

It adds the characters of one string to the end of another string. It is used to join the two strings together.

Syntax: strcat(stringl, string2); 

Ex: string1 = ”Bharath” string2 = ”Bhushan”, strcat(stringl, string2);

Output: Bharath Bhushan

3. Strrev() Function:

It reverses the characters in a string.

Syntax: strrev(string);

Ex: strrev(“ABCD”);

Output: DCBA

4. Strlwr() Function

Converts all characters in a string to lower (small letters) case. 

Syntax: strlwr(string);

Ex: strlwr(“BHARATH”)

Output: bharath

5. Strupr() Function

Converts all characters in a string to upper (capital letters) case.

Syntax: strupr(string);

Ex: strupr(“bharath”)

Output: BHARATH 

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...