String s = "the text=text" String s1 = s.substring(s.indexOf("=")+1); s1.trim(); 

Read more of this post