[UE4]FString常用API

2021-05-04 03:29

阅读:439

标签:rom   har   col   nbsp   count   常用   ext   字符串截取   ring   

转自:http://aigo.iteye.com/blog/2279808

将int或float转换为string:

 
FString NewString = FString::FromInt(YourInt);  
FString VeryCleanString
= FString::SanitizeFloat(YourFloat);

将FString转换为char*:

FString s;  
char *c = *s;  

 将string转换为int或者float:

FString TheString = "123.021";  
  
int32 MyShinyNewInt = FCString::Atoi(*TheString);  
  
float MyShinyNewFloat = FCString::Atof(*TheString);  

字符串切割:

FString a("1,2,3");  
TArray stringArray;  
a.ParseIntoArray(stringArray, TEXT(","), false);  

字符串截取:

FString::Left(int count);  
FString::Right(int count);  

 

[UE4]FString常用API

标签:rom   har   col   nbsp   count   常用   ext   字符串截取   ring   

原文地址:http://www.cnblogs.com/sevenyuan/p/7728152.html


评论


亲,登录后才可以留言!