Загрузка страницы

Java How to remove last character from string

How to remove the last character from a string?
This video explains how to do that in Java, WE using the substring() method to achieve that

Below is the program
public class StringTutorial {
public static void main(String args[]){
String name="Spring,";
System.out.println("before:"+name);
String newname=name.substring(0,name.length()-1);
System.out.println("after:"+newname);

String newname2=name.substring(name.length()-1);
System.out.println("after2:"+newname2);

}
}

Видео Java How to remove last character from string канала smashplus
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
24 января 2019 г. 22:19:37
00:03:47
Яндекс.Метрика