[Refactoring] Simplify the code for DIP29
fix Issue 12467 - char[] is implicitly convertible to string