Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Accessing of character by character from a String...  RSS feed

Chan Lee
Posts: 25
  • Mark post as helpful
  • send pies
  • Report post to moderator
hiii friends,
Since I'm very new to JAVA, I've lots of doubts in my mind. Even they are silly doubts for you , as a bigginner I wanna know the solution.

One of my doubts is, I've

String s1 = new String("abcd");
String s3 = new String();
int len = s1.length();

I can't use .......
for(int i=0;i<len;i++)
s3[i] = s2[i];

how to access character by character from the String s1 and place one by one into s3?( I know that s1 = s3 will do this job. But, I want to assign one by one to String s3).
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!