Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
Integer myInt = Integer.valueOf('123');
Integer myInteger = 22; String sInteger = String.valueOf(myInteger); System.assertEquals('22', sInteger);
Integer convertStringToInteger= Integer.valueOf('SomeStringValue');
valueOf(stringToInteger)
Returns an Integer that contains the value of the specified String. As in Java, the String is interpreted as representing a signed decimal integer.
Signature
public static Integer valueOf(String stringToInteger)
Parameters
stringToInteger
Type: String
Return Value
Type: Integer
Example:
valueOf(integerToConvert)
Returns a String that represents the specified Integer.
Signature
public static String valueOf(Integer integerToConvert)
Parameters
integerToConvert
Type: Integer
Return Value
Type: String
Example
Also look into below links for more information:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_integer.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_string.htm#apex_System_String_valueOf_5
Please do let me know if it helps you.
Regards,
Mahesh
You can use this to Convert From Integer To String:-
String convertIntegerToString= String.valueOf(IntegerValue);
For String To Integer You may use this one:- If you find your Solution then mark this as the best answer.
Thank you!
Regards
Suraj Tripathi