public class MatchBackslashRegex { public static void main(String[] args) { String string = "Element1\\Element2"; String[] strArr = string.split("/\\\\"); System.out.println(strArr[0]); // returns Element1 } }
public class MatchBackslashRegex { public static void main(String[] args) { String string = "Element1\\Element2"; String[] strArr = string.split("/\\\\"); System.out.println(strArr[0]); // returns Element1 } }