I need to get the unique name from a string and concatenate with an integer in java.So I want to take first letter of the string and increment that letter with an integer.
Example: tenant name:
“ani,raj,rob” and i need to get the
schema name like a001,r001,r002
here r value will be incremented because of repetition.So I request you to help me find answer for this.I am getting the first letter from a string but I need to concatenate that with an integer.
String name = new String(tenantName);
char sc=tenantName.charAt(0);
String whereClause="tenant_id= select max(tenant_id) from tenant_connection_details
tcd1 where schema_name like'"+sc+"%'";
tenantList= tenantImpl.getAllTenantsByWhereClause(whereClause);
1 Answer