Please edit your question to be more clear, this will help others...
this is what you want
you want to get the url beffore first ampersand
or
remove the string, at first ampersand to end
example:
String url = "https://www.example.com/pic?id=12345&xyz&pqr?id=0987654321/etc/etc";
System.out.println(url .indexOf("&"));
System.out.println(url .substring(0,url .indexOf("&")));
//output
//36
//https://www.example.com/pic?id=12345
//what do you want
EditText editText = (EditText) findViewById(R.id.example);
editText.setText(editText.getText().toString().substring(0,editText.getText().toString().indexOf("&")));
Sources:
get index of first character with indexOf
get string form an intervale of index position