0% found this document useful (0 votes)
17 views

string_tutorials

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

string_tutorials

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

● Write a program to extract a portion of a character string and

print the extracted string. Assume that m characters are


extracted, starting with the nth character.
● Write a program which will read a text and count all occurrences
of a particular word.
● Write a program which will read a string and rewrite it in the
alphabetical order. For example, the word STRING should be
written as GINRST.
● Write a program to replace a particular word by another word in
a given string. For example, the word “PASCAL” should be
replaced by “C” in the text “It is good to program in PASCAL
language.”
● Write a program that reads a string from the keyboard and
determines whether the string is a palindrome or not. (A string is
a palindrome if it can be read from left and right with the same
meaning. For example, Madam and Anna are palindrome
strings. Ignore capitalization).
● Write a program to read a line of text from the keyboard and print
out the number of occurrences of a given substring.
● Write a program that will copy m consecutive characters from a
string s1 beginning at position n into another string s2.

You might also like