Is there a safe way to convert from an FString of unknown content to a float (or int)? The wiki states on this page that I should use FCString::Atof(), but ideally I would like to check that the string is reasonable to convert prior to calling this and handle poor input as needed.
For example, if an input string is βfooβ it is not safe to call FCString::Atof().
Hehe, fair enough. I was more looking for a pre-written function if there was one so that I could avoid writing unnecessary code. The function exists so Iβve answered and marked it as correct.
I recommend FDefaultValueHelper::ParseFloat if you need the string to have decimals. IsNumeric() would return false with β12.12β because of the β.β while ParseFloat recognises itβs a float.