I'm trying to remove url from some strings that i get from twitter. The code i use is:
test.replaceAll("http.*?\\s", ""));
The problem is that when i try there are some strings it doesn't work, for example:
String cuatro = ("#TodosPorKiKi El plan de flia solidaria No Puede exceder los 6meses. La justicia de Santa Fe lo abandonó 2 años y ahora\r\n" +
"Quieren hacerse los legalistas\r\n" +
"#Verguenza Respete los derechos del niño @MiguelLifschitz @DataLifschitz https//t/MUY0bj2qMT");
output:
I dont`t know why for some text it works and for other doesn't
str.split("..", ' ')and remove the element that starts with usingstr.startsWith("..")methodhttp:// or https://\\s(whitespace) at the end, that means it won't work if the URL is at the end of input.