c# - String Replace not work -
i have string (an example of value {"id":"123241077871_4423423423414"}
) , require part numbers , underscore. however, way of doing string.replace
method doesn't work. can me?
this i've tried:
settings.default["lastid"].tostring().replace('{"id":"'+"}',null);
your code should be
settings.default["lastid"].tostring().replace("{\"id\":\"", "").replace("\"}","");
as jon skeet said, currently, it's not valid string literal. in addition, replace searches 1 string of text. can't both of them in 1 pass.
Comments
Post a Comment