Here you can find the source of extractStreetName(String address)
public static String extractStreetName(String address)
//package com.java2s; //License from project: Apache License import java.util.Arrays; public class Main { public static String extractStreetName(String address) { String[] parts = address.split("\\s"); for (int i = parts.length - 1; i >= 0; i--) { String part = parts[i]; if (part.length() > 3 && !part.contains("/") && !part.matches(".*\\d.*")) { return String .join(" ", Arrays.copyOfRange(parts, 0, i + 1)); }//w w w . j a v a2 s .co m } return ""; } }