Skip to content

Commit f201986

Browse files
author
Ram swaroop
committed
code refactoring
1 parent 80a4649 commit f201986

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/me/ramswaroop/misc/MethodLocalVSInner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ public static void main(String[] args) {
2020
}
2121

2222
void go() {
23+
new A().m();
2324
class A {
2425
void m() {
2526
System.out.println("inner");
2627
}
2728
}
28-
new A().m();
2929
}
3030

3131
class A {
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package me.ramswaroop.misc;
2+
3+
/**
4+
* Created by IntelliJ IDEA.
5+
*
6+
* @author: ramswaroop
7+
* @date: 11/3/15
8+
* @time: 2:21 PM
9+
*/
10+
public class ReplaceAll {
11+
12+
public static String replaceAll(String str, String regex, String replacement) {
13+
return str.replaceAll(regex, replacement);
14+
}
15+
16+
public static void main(String a[]) {
17+
System.out.println(replaceAll("ram s", "\\s+", ""));
18+
}
19+
}
20+
21+

0 commit comments

Comments
 (0)