ex 1 et 3 en cours (todo ex 2)
This commit is contained in:
@@ -5,7 +5,17 @@ public class StringUtils {
|
||||
private StringUtils() {}
|
||||
|
||||
public static boolean isBalanced(String str) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static String reqIsBalanced(String str){
|
||||
String all = "[\\[\\(\\{\\]\\)\\}\"]";
|
||||
String openRegex = "[\\[\\(\\{\"]";
|
||||
String closeRegex = "[\\]\\)\\}\"]";
|
||||
String regex = "^[^"+all+"]*"+openRegex+"."+closeRegex+"^["+all+"]*";
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,12 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
class StringUtilsTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void test2(){
|
||||
//assertEquals(num1,num2);
|
||||
String s = "te";
|
||||
String s2 = "test";
|
||||
s += "st";
|
||||
assertSame(s2,s);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user