I read from the DB a long json. I want just one attribute of that json.
I have got two options: a. Create an interface for that json and deserialize to that interface.
Finding the substring is a dangerous optimisation.
Is it worth optimising the process (compared to a JSON deserialization) and safe to do such a lookup ? We can't answer yes because it's mostly dependent on the context. But I feel like saying NO because it's obviously looking for trouble: Even if it works now, it may get broken in the future when the structure or contents of you object changes.