How to assign component name during run-time?

In the Below code, I’ve assigned StaticMeshComponent name as “StaticMeshComponentCOMP1, StaticMeshComponentCOMP2”. It is not very efficient for N component.

 StaticMeshComponent[i] = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMeshComponentCOMP1"));
  StaticMeshComponent[i] = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMeshComponentCOMP2"));

So I’ve tried to assign StaticMeshComponentCOMP with auto increment as below, but couldn’t able to achieve the result.

StaticMeshComponent[i] = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMeshComponentCOMP" + '%i'));

thank you for your help in advance

I added a number parameter to my component’s name like this:

MyMesh = ObjectInitializer.CreateDefaultSubobject(this, FName(*FString::Printf(TEXT(“MyMesh%d”), MeshNumber)));

It works, but I’ve got the feeling that there’s a nicer/more efficient solution than creating an FString and then converting it to an FName. But I don’t know how to create a formatted FName directly. Maybe someone else has a solution for that?

Thanks, I’ve solved this problem by using the below code; FString name = FString(TEXT(“StaticMeshComponentCOMP”));
name.AppendInt(i);
FName temp = FName(*name);