In the future, it would be helpful to say what the error is. It might not mean anything to you, but it might to us.
This code:
if (Payload[0] = "S")
{
do something
}
has three problems.
The first is that "S" is a string, of length one. It can not be compared to a character. On the other hand, 'S' is a character, and can be compared to Payload[0].
The second is that = is an assignment operator. The equality comparison operator is ==.
The third is that "do something" is not valid syntax. I'll assume you left off the comment indicator.