java - Increase string value -


java question here: if have string "a", how can "add" value string, "b" , on? "a++"

string str = "abcde"; system.out.println(getincrementedstring(str)); 

output

bcdef

//this code give next char in unicode sequence

public static string getincrementedstring(string str){         stringbuilder sb = new stringbuilder();         for(char c:str.tochararray()){             sb.append(++c);         }         return sb.tostring();     } 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -