[Go to site: main page, start]

0% found this document useful (0 votes)
2 views1 page

String Manipulation Techniques Guide

The document outlines various string manipulation tasks including finding string length, converting cases, comparing strings, checking prefixes and suffixes, accessing specific characters, reversing strings, counting vowels, checking for palindromes, removing spaces, splitting strings, replacing words, extracting substrings, counting character frequency, searching for words, and finding character occurrences. Each task is accompanied by a sample string for illustration. These operations are fundamental for string handling in programming.

Uploaded by

Akash Gupta
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)
2 views1 page

String Manipulation Techniques Guide

The document outlines various string manipulation tasks including finding string length, converting cases, comparing strings, checking prefixes and suffixes, accessing specific characters, reversing strings, counting vowels, checking for palindromes, removing spaces, splitting strings, replacing words, extracting substrings, counting character frequency, searching for words, and finding character occurrences. Each task is accompanied by a sample string for illustration. These operations are fundamental for string handling in programming.

Uploaded by

Akash Gupta
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

1. Find the length of the string.

Sample: "Akash"

2. Convert a string to uppercase and lowercase. Sample: "Java Programming"

3. Compare two strings for equality. Sample: "Hello" and "Hello"

4. Check if a string starts with 'www' and ends with '.com'. Sample: "[Link]"

5. Print the character at a specific index. Sample: "Java" at index 2

6. Reverse a string. Sample: "hello"

7. Count vowels in a string. Sample: "education"

8. Check if a string is a palindrome. Sample: "madam"

9. Remove all spaces from a string. Sample: "Java is fun"

10. Split a string into words and print each word. Sample: "Learning Java Strings"

11. Replace all occurrences of a word in a string. Sample: "Java is awesome", replace "Java" with
"Python"

12. Extract a substring from a given string. Sample: "Programming", substring from index 0 to 6

13. Count the frequency of each character in a string. Sample: "banana"

14. Check if a string contains a particular word. Sample: "Welcome to Java world", search "Java"

15. Find the index of first and last occurrence of a character. Sample: "mississippi", character 's'

You might also like