How to convert from FString to uint64

Hi,

I just want to convert a FString to a uint64 variable type. How can I do that?

I found about FCString::Strtoui64() but I have no clue how to use that.

Thanks

Strings and ints aren’t obviously related. This question isn’t answerable unless you say how you want the int to relate to the string it was created from.
Do you want a hash you can use to compare two strings and be fairly certain they have the same contents?
Do you want an int which can somehow be converted back into a string?
Do you want the memory address of the string so you can verify two strings are the same instance?
Do you want the length of the string?

Back in someewhere esle in the code. I got from Steam a uint64 for a workshop item ID. I save that in the location of the WorkshopItem as WorkshopID.txt with it having inside something like “2906622092” for example.

In order to update an exisiting workshop item with the changes the player makes. I need to read the workshopID in order to call the Steam function to update the WorkshopItem as the WorkshopID is one of the parameters in uint64 type.

Currently I have this written in the code. It haven’t compiled it yet, soon. But It doesn’t yield any errors.

uint64 PublishedFileID = FCString::Strtoui64(*WorkshopItemID, NULL, 10);

A lot of that depends on how you’re reading the workshop item ID from WorkshopID.txt. Are you doing it in a way that returns a CString? (As opposed to an Unreal FString. Your question title implies that you have the later, which means FCString probably isn’t going to do what you want.)

I just testeed it and it worked properly. As the workshop item was succesfully updated because it read the workshopID.txt file in FString format, and then simply converted it into a uint64

uint64 CClass::FStrToUInt64(FString Number) {
uint64 PublishedFileID = FCString::Strtoui64(*Number, NULL, 10);
    return PublishedFileID;
    }

Note that at the moment you can’t expose uint64 to blueprints from your code.