You need to sign in to do that
Don't have an account?
dlCamelot
Converting Value to String
Hi All,
I'm trying to get an array of strings returned based on Integer n, but seem to keep getting a value returned instead of a string. What do I need to adjust? Thanks!
public class StringArrayTest {
public void generateStringArray(){
List<String>stringArray = new List<String>{};
Integer n = 4;
for(Integer i=n;i<stringArray.size();i++){
String myInt = n.format();
stringArray.add('Test' + myInt);
}
return stringArray;
}
}
I'm trying to get an array of strings returned based on Integer n, but seem to keep getting a value returned instead of a string. What do I need to adjust? Thanks!
public class StringArrayTest {
public void generateStringArray(){
List<String>stringArray = new List<String>{};
Integer n = 4;
for(Integer i=n;i<stringArray.size();i++){
String myInt = n.format();
stringArray.add('Test' + myInt);
}
return stringArray;
}
}
Use below code to convert integer to string Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.