This repository provides a comprehensive guide and practical examples for string manipulation in Java. It covers essential string operations that are commonly used in software development.
String manipulation is a fundamental skill for any software developer. In Java, the String
class provides numerous methods to handle and process text effectively. This repository serves as a learning resource for understanding and applying these string manipulation techniques.
- String Indexing: Understanding how characters in strings are indexed (0-based)
- String Comparison: Methods to compare strings with/without case sensitivity
- Substring Operations: Finding, extracting, and validating substrings
- String Transformation: Converting strings to different cases, trimming spaces, etc.
The src
directory contains practical examples organized by functionality:
- basics: Fundamental string operations
- search: Methods for finding substrings and checking prefixes/suffixes
- comparison: Ways to compare strings
- practical: Real-world applications of string manipulation
The exercises
directory contains practice problems to test your understanding:
- Exercise 1: Check if a string contains "good" and display appropriate message
- Exercise 2: Compare different names while ignoring case
The docs
directory contains detailed explanations of:
- String indexing in Java
- Available string methods and their usage
- Practical examples and use cases
-
Clone this repository:
git clone https://github.com/yourusername/java-string-manipulation.git
-
Navigate to the specific example you want to study:
cd java-string-manipulation/src/basics
-
Compile and run any Java file:
javac StringIndex.java java StringIndex
This project is licensed under the MIT License - see the LICENSE file for details.