C++: modify string

Signed-off-by: Micky Ching <mickyching@gmail.com>