I need to remove a ';' from a string array. Any solutions?
What I did in my class was retrieving a long piece of string which are connected without spaces
(thisisalongpieceofstringtobeseparated)
I separated them by inserting a ';' between them
(this;is;a;long;piece;of;string;to;be;separated;)
Then I used .split(";") to add them to an array. All is successful but the last index which has a ';'.
this
is
a
long
piece
of
string
to
be
separated;
Need to remove the last ;
As requested, code is below.
while (line != null) {
if(line.contains("../../"))
{
int startIndex = line.indexOf("../../") + 6;
int endIndex = line.indexOf(">", startIndex + 1);
String abc = "http://www.google.com/";
String imageSrc = line.substring(startIndex,endIndex);
//complete full url
String xyz = abc +imageSrc;
xyz = xyz.substring(0,xyz.indexOf('"'));
xyz = xyz +";";
content += xyz;
mStrings = content.split(";");
Nothing special in the code, i mean if you are using spilt() then it’s already worked for you, if not then there is something wrong with your code,Post your code to see what exactly wrong with your code or else do this way