You need to find the index of [ and ] then substring. (Here [ is always at start and ] is at end):
String loginToken = "[wdsd34svdf]";
System.out.println( loginToken.substring( 1, loginToken.length() - 1 ) );
You need to find the index of [ and ] then substring. (Here [ is always at start and ] is at end):
String loginToken = "[wdsd34svdf]";
System.out.println( loginToken.substring( 1, loginToken.length() - 1 ) );