Structure of a Fstring. My Isogram function

My Isogram checking function. Nothing original here, just a char checking loop.

bool UBullCowCartridge::IsAnIsogram(FString str)
{
	for (int i = 0; i < str.Len(); i++)
	{
		for (int j = 0; j < str.Len(); j++)
		{
			if (i != j)
			{
				if (str[i] == str[j])
				{
					return false;
				}
			}
		}
	}
	return true;
}
1 Like

Ducking awesome! I’m not there yet but yours seems so complicated and cool. On lesson 62 currently :face_with_hand_over_mouth:

But why put the "str " after FString?

Hi the Fstring is the type of variable and the str is just the name of it. str could be called whatever you want.

I hope that makes sense.

:ok_hand: :+1: Thanks I just saw it in lesson 63 an hour ago. I used “Word”. Don’t you need to capitalize though? for variables in Unreal.

And shouldn’t int be int32?

Cool Word works, I think that’s what Michael used.

As for conventions, I think I’m used to Unity more than Unreal, which is why I tend to use non capitals for variables. But yea if you are working in a team just go with the flow, good questions and point.

Int vs int32. not a huge difference, but it’s good to ask.

Hope you are enjoying the coarse.

Thank you

Privacy & Terms