I'm sending a message to telegram channel and i have error
Simple string sent, but modified by the type of part of the array is not sent
 String urlString = "https://api.telegram.org/bot%s/sendMessage?chat_id=%s&text=%s";
    String apiToken = "123843242734723";
    String chatId = "@Example";
    String text = Array[i]+ " hello";
    urlString = String.format(urlString, apiToken, chatId, text);
    URL url = null;
    try {
        url = new URL(urlString);
    } catch (MalformedURLException e) {
        e.printStackTrace();
    }
    URLConnection conn = url.openConnection();
Exception in thread "main" java.net.MalformedURLException: Illegal character in URL