On the C++ side it lives in wcstringutil.cpp. We should probably keep it there until we have ported the entirety of that file.