0

I want to have an input as such

final String input = "one=1&two=2";

And I am using a Map method

public Map<String, String> decode(String s) {
    if(!s.isEmpty()){
        for(int i = 0; i < s.length(); i++) {
            s.split("&");
        }
    }
}

I am stuck here ,trying to write the algorithm that will check a string such as the one I wrote above and return mapping like

 ("one", "1");
 ("two", "2");

I wrote a regex like this ^[a-z0-9 +=][{1,}]$

takendarkk
  • 3,347
  • 8
  • 25
  • 37
valik
  • 2,014
  • 4
  • 24
  • 55

0 Answers0