12 | JAVA String Methods -l- Malayalam Tutorial
Автор: Tech Edu Hub Malayalam
Загружено: 2024-06-09
Просмотров: 482
Описание:
In this video, we dive into the world of Java String methods. Strings are an essential part of Java, and mastering them can significantly enhance your coding skills. Whether you’re a beginner or looking to brush up on your knowledge, this tutorial covers basic methods you need to know about working with Strings in Java.
Lets learn the functions - length(), toUpperCase(), toLowerCase(), charAt(), indexOf(), substring(), replace()
Please find the code below:
public class JavaStrings {
/*
Strings are used for storing text.
A String variable contains a collection of characters
*/
public static void main(String[] args) {
String name = "Akshay Kumar";
int len = name.length();
System.out.println("Length of the String is : " + len);
String capital = name.toUpperCase();
System.out.println("Print Captital : " +capital);
String small =name.toLowerCase();
System.out.println("Print Small letters :" +small);
//--------------------------------------------------------------------
String text = "Hello World";
char letter = text.charAt(7);
System.out.println("The character is : " +letter);
int index = text.indexOf("W");
System.out.println("Index of the letter is " +index);
String subText = text.substring(3);
System.out.println("Substring of text is : "+ subText);
String sub2 = text.substring(0, 8);
System.out.println(sub2);
String replacedText = text.replace("l", "z");
System.out.println(replacedText);
}
}
Повторяем попытку...

Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: