Is there anything earlier in the code that checks is 'str' (the name being passed in that variable) is not an empty string? If not, then the 'SubString' would explode. Maybe that's not even an issue because you'd be sending broken json =) Either way, could you change this to use a 'string.Concat' instead? Thanks