Given an input of the string "50, 54, 46, 48, 48,", you need to first convert that to an array of bytes.
The format isn't ideal as it isn't in a standard like JSON. If you are able to change whatever is producing that string, that would make your life easier.
But if we take the format you have shared as a given, then...
// Split the string into array of individual values
var parts = msg.payload.split(",");
// Remove the last blank part caused by the trailing comma
// Parse each part of the string to a number
var bytes = parts.map(v => parseInt(v))
// Create a new Buffer from those bytes and convert back to String
msg.payload = Buffer.from(bytes).toString();
I think I shall let him answer the question better than I can.
But I think there is a problem with what you are typing. String (note the capitol S) will make 19 a string.
But I think there is a problem with the "50, 54, 46, 48, 48".... I think that is an array.