ok i will try.but i don't know to use map,if u could post some links to learn about it,it would be helpful.
Type: Posts; User: shenaz
ok i will try.but i don't know to use map,if u could post some links to learn about it,it would be helpful.
class keys{
public static void main(String[] args)
{
String str="if(a greater than b)";
if(str.contains("greater than"))
str=str.replace("greater than",">");
if(str.contains("lesser than"))...
am trying to read a string and check if it contains the keywords am looking for.If it contains those keywords,i should replace it with operator.
now to check if a string contains the keyword if...
I know how to use replace() method.my problem is when i read a string,how should i check if it contains the keywords i mentioned in post#1,and then replace with its corresponding operator.
its about replacing only.but am not understanding how to do it.
Ya i tried.I just want to know what concept i should use for the problem i stated.
Suppose i have a string as fallows
if(a greater than b)
and i want to replace "greater than" with ">",how should i replace?
i want to replace the following keywords with corresponding operators...