Remove \n on stream title

hi everybody,

I retrieve the name of the stream with a Helix query.
The problem is, I can’t seem to get the files out.

Here’s my code :

                BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
		String inputLine;
		StringBuffer response = new StringBuffer();
		while ((inputLine = in.readLine()) != null) {
			response.append(inputLine);
		}
		in.close();

		JSONObject myResponse = new JSONObject(response.toString());

		String response_to_string = myResponse.getJSONArray("data").toString();
		String[] my_data_split = response_to_string.split(",\"");

		if (user_if_stream[i] == false && response_to_string.contains("id")) {
			System.out.println(user_name[i] + " est en live aller le voir");
			String stream_title = my_data_split[MesFonctions.searchInArrayString(my_data_split, "title")];
                        stream_title = stream_title.substring(8, stream_title.length()-1);
			if(stream_title.contains("\\n")) {
				System.out.println(stream_title.replaceAll(System.lineSeparator(), ","));
				System.out.println(stream_title.replaceAll("(\\r\\n|\\n)", ","));
                                System.out.println(stream_title.replaceAll("\\n", ","));
                                System.out.println(stream_title.replaceAll("\n", ","));
			}

Here are the answers :

Développeur de la team FÑDS.\nTest pour un bot discord\néàéàé :red_circle:
Développeur de la team FÑDS.\nTest pour un bot discord\néàéàé :red_circle:
Développeur de la team FÑDS.\nTest pour un bot discord\néàéàé :red_circle:
Développeur de la team FÑDS.\nTest pour un bot discord\néàéàé :red_circle:

On Twitch.tv = Développeur de la team FÑDS. Test pour un bot discord éàéàé :red_circle:

In the broadcast options :

Développeur de la team FÑDS.
Test pour un bot discord
éàéàé :red_circle:

Thanks

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.