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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -