Y
Y
yourDaddy13372022-02-13 12:42:25
Java
yourDaddy1337, 2022-02-13 12:42:25

How can I make text animation?

Hello! I have, for example, a variable in which there is text: And I need the symbol "&k" to shift by 1 letter in the loop, for example: 1st iteration: " &k Hello" 2nd iteration: "H &k ello" 3rd iteration: "He &k llo" And so on, but when the characters "&k" have no place to move, they go back to the beginning of the text .
public String text = "Hello";



Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2022-02-13
@yourDaddy1337

Through .substring try.
- Cut off n characters first: .substring(0, n)
- Cut off from the nth character to the end: .substring(n)
- Glue what happened with your &k

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question