Find() for an FString array always returns -1?

Here’s the code I’m using, and it’s a bit of a mess but the code isn’t the problem…

for (int32 ClassIndex = 0; ClassIndex < TileClassArray.Num(); ClassIndex++)
{
	AlphabetIndex = AlphabetArray->Find(TileClassArray[ClassIndex]->TileCoordinates.Column);

	if (AlphabetIndex > NumberOfColumns)
	{
		NumberOfColumns = AlphabetIndex + 1;
	}
}

I assumed it was because it somehow didn’t think that what I was searching for with Find() was in the TArray, so I added an if statement to see if any elements in the array matched up with the FString I was searching for, and it returned true. So it knows that one of the elements in the array matches the element I’m searching for, but for some reason, the Find() can’t find it.

Does anyone know what the problem could be?
Thanks in advance

Your code is hard to read can you add declarations and types? Why do you use → when AlphabetArray is a struct?

The TileClassArray is an array of an actor class that has a variable of a user-defined struct, “TileCoordinates,” which is comprised of an int32 “Row” and FString “Column.” AlphabetIndex is an int32, and AlphabetArray is an array of FStrings, each containing one letter of the alphabet. NumberOfColumns is another int32.

if you just want to get the index of the alphabet you can get the char of an string and use that to determine the index. In UTF8 a is 97 and z is 122 so you dont need to have an array with the letters of the alphabet

FString str = "A";
int index = str.ToLower()[0] - 97;

Ah, that works perfectly. Thanks! How can you reverse it? I.e. converting an integer to a string?