cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert int into String

10-17-2009 9:42 AM
384 views 1 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Dear Experts,

How I can convert int in to String?

I have following code

int j = 0;
j = wdContext.currentContextElement().getFromUserIDForRoleAssignment();
int k = 0;
k = wdContext.currentContextElement().getToUserIDForRoleAssignment();
int l = 0;
l = j + l;
if (thisUser.getUniqueID().equals(j)  {
					}

The above code is failing as thisUser.getUniqueID().equals(j) is incorrect syntacially. I have to convert j into string.

Regards,

Gary

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

jmoors
Active Contributor
0 Likes

Converting int to String is straightforward, however are sure you actually need to? The Unique user id isn't normally an integer value, i.e. it normally has a datasource prefix etc. Therefore even if you convert J in you example code to a String I don't believe the strings will ever match.

To convert int to String you can use either of the following static methods.

String.valueOf(int)

Integer.toString(int)

regards,

Jason

Answers (0)