Core: Remove native String#trim usage to save size

Fixes #14794