Possible Duplicate:
Platform::String is kind of useless
I’m new to Windows development and the new Visual C++ APIs are driving me nuts. I’ve most recently run into a seeming lack of string functions. Are there basic functions available such as:
- substring
- strpos or similar
- regular expressions
My ultimate goal is to take a file path such as “C:\foo\bar\baz.jpg” and extract the deepest directory. In this example, I’m looking for “bar”.
Perhaps of a greater concern, I’ve found that it’s incredibly difficult to find current documentation for Win 8 APIs. What’s the best place to look for questions like this?
WinRT C++/CX classes like
Platform::Stringshould be used only at the boundary of your apps/components. Inside your apps/components you should just use ordinary ISO C++ classes.So you can just use
std::wstring(sincePlatform::Stringis Unicode) with its methods and Boost’s helpers, and then convert from/tostd::wstringto/fromPlatform::Stringat the boundary.