I have a string variable and another string assigned to the same variable. Then how to get the old row?

Suppose I have a string

msg = "hello"

Now I get the substring from the string msgasmsg.substring(1,msg.length())

And keep that substring in msg.

So msgrefers to a new line. If the old line also remains in the java buffer and yes, then how to access it?

+4
source share
2 answers

( Java, String msg), โ€‹โ€‹(). , , , . .

. , Java 7u6 .

+3

, String.substring() String Java 7 ( 6, IIRC)

, Java:

  • Java 7u6, . String.substring()
  • Java, char String, char

2 , , .

substring() . .

+8

Source: https://habr.com/ru/post/1541411/


All Articles