Today, I met with problem i should use tool of substring to solve.
So, I investigated some sites and I studid that tool.
Let's start it!
First of all, It has two kinds of method.
❏ String substring(int index)
This method gets the String from the index position to the last character positon.
Let me show you an example.
This will print "345".
Because 'substring' starts from 0 not 1.
❏ String substring(int beginIndex, int endIndex)
This second method gets the String from the beginIndex position to the front of endIndex position.
Let me show you an example too.
This will print "34".
Keep in mind. not up to 5.
📌 If you try to get something out of range, you get an error.
--------------------------------------------------------------------------------------------
'develop' 카테고리의 다른 글
1주차 과제: JVM은 무엇이며 자바 코드는 어떻게 실행하는 것인가. (0) | 2021.02.21 |
---|---|
[java] What is 'split' ? (0) | 2021.02.12 |
난수 생성 (Random 클래스) (0) | 2021.02.10 |
split 으로 문자열 나눠 배열에 저장 (0) | 2021.02.10 |
String to int , int to String (0) | 2021.02.10 |