Java Tutorial - 18 - Replacing Characters in a String

preview_player
Показать описание

Learn how to program in java with our online tutorial. We will cover variables, loops, if else branching, arrays, strings, objects, classes, object oriented programming, conditional statements, and more.

Learn how to replace a character in a string in java.
Рекомендации по теме
Комментарии
Автор

I love having Gun in the amusement park in Glorida

nicholasmercer
Автор

I was struggling with the replace method and you made me realize that while I was using .replace(x, y) correctly, I forgot to actually set the value equal to my variable 🤦

Thank you for the helpful video overall though

iio.kamera
Автор

3:41 "I love having Gun in the amusement park in Glorida" - Math and Science, March 2018.

GabrielTobing
Автор

But how do you replace/append to a line already printed to the console, like if you wanted to print the numbers first, like
1.
2.
3.
4.
and then go back to write in front of each number to try to create sort of an effect...?

BrennerEraFan
Автор

How can I convert a string without replace method

maheshwarans
Автор

i love having guns in the florida amusement park as well

richardli
Автор

Good explanation sir but can you perform the same program using method overloading. Without using string.

naveendangi-chemistryclass
Автор

Ive been looking for 18 hours. I dont know anything about java. How do i replace words in a sentence with words from an array?

joncalvert
Автор

how do i replace it without the replace method\

ayyybeeeeee
Автор

How to change multiple character by replacing different values for example I want to replace a =1 and b=2

boopathigovindarajan
Автор

I dont have replace in my Netbeans IDE 12.0

juraijbinjamal
Автор

package javaapplication211;
import java.util.Scanner;
public class JavaApplication211 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);

String frase;

System.out.println("Digite uma frase: ");
frase = in.nextLine();

frase = frase.replace("a", "@");
frase= frase.replace("e", "$");
frase = frase.replace("i", "&");
frase = frase.replace("o", "*");
frase = frase.replace("u", "#");

System.out.println(frase);
}
}

joaojv