-3
String test = "{helloworld=Text to be filtered}";

I need to get "Text to be filtered" from the above string. Please help. Thanks in advance.

Hello World
  • 103
  • 1
  • 2
  • 6

2 Answers2

0

you can make use of String.split() method in this case.

String test = "{helloworld=Text to be filtered}";
String testAfterSplit[] = test.split("=");

testAfterSplit[0] will be holding the value "{helloworld" and testAfterSplit[1] will be holding the value "Text to be filtered}"

you can read more about split here

droidev
  • 7,352
  • 11
  • 62
  • 94
  • I got the answer myself ! String test = "{helloworld=Text to be filtered}"; String test2 = test.replace("{helloworld=",""); String test3 = test2.replace("}",""); Now I can use test3 string :D That's all I found myself. – Hello World Dec 03 '15 at 02:34
0

You can use indexOf method. It retruns the position of character you want. In this case:

int pos = text.IndexOf("=");
String filter = text.substring(pos, text.length());

It returns an string from position of = to the end.