Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 57f8f66

Browse files
add RemoveAChar.java
1 parent a6a4308 commit 57f8f66

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

‎src/RemoveAChar.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class RemoveAChar {
2+
3+
public static void main(String[] args) {
4+
5+
String word = "GitHub";
6+
7+
System.out.print("word to be modified `");
8+
System.out.print(word);
9+
System.out.print("` ...");
10+
System.out.print(" script will remove ");
11+
12+
String charToBeRemoved = "H";
13+
String charToReplace = "-";
14+
15+
System.out.print(charToBeRemoved);
16+
System.out.print(", to be replaced by ");
17+
System.out.print(charToReplace);
18+
System.out.print(", result: `");
19+
20+
word = word.replace(charToBeRemoved, charToReplace);
21+
22+
System.out.print(word);
23+
System.out.println("`");
24+
25+
}
26+
27+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /