I have an api response which is been parsed to a map using JSON.deserializeUntyped function. In the response , i have a key value pair as:
'{"primaryuser": "test\\test"}'
When i try to fetch it from the map , i need the backslash character. But below string is obtained :
test\test.
Now since backslash character is escaped , when i try to find backslash character , it doesn't showup.
Please find below code for reproducing this issue :
String str = '{"primaryuser": "test\\test"}';
Map<String,Object> maps= (Map<String,Object>)JSON.deserializeUntyped(str);
System.debug('str '+str);
System.debug('value '+maps.get('primaryuser'));
Below is the debug log which i'am getting :
18:42:44.27 (29338484)|USER_DEBUG|[4]|DEBUG|value test est