There is a line like "dom15 / 2". How can you find the border between letters and numbers and put a space there. The problem is precisely in determining that the current character is not a string.

    2 answers 2

    String addr = "дом15/2"; System.out.println(String.join(" ", addr.split("(?<=[а-я]+)(?=\\d+)"))); 

      You can like this:

       String text = "дом15/2 2/4a"; StringBuilder builder = new StringBuilder(text); for (int i = 1; i < builder.length(); i++) if (Character.isAlphabetic(builder.charAt(i - 1)) && Character.isDigit(builder.charAt(i))) builder.insert(i, ' '); System.out.println(builder.toString());