Commit 7a38177
committed
feat: Demonstrate usage of Java String substring() method
- Created a simple `Substring` class to showcase the `substring(int beginIndex)` method of the `String` class.
- Defined a string variable `name` with the value "Virat Kholi".
- Extracted a substring starting from index 5 using `name.substring(5)`, which returns "Kholi".
- Printed the resulting substring to demonstrate how the method returns the portion of the string from the specified index to the end.
This commit provides a basic example of Java's substring functionality, useful for string manipulation tasks.
Signed-off-by: Somesh diwan <[email protected]>1 parent 76268d2 commit 7a38177
File tree
1 file changed
+1
-1
lines changed- Section6StringClassPrinting/Engineering Digest ED/src
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
0 commit comments