Home » Java Program to separate the Individual Characters from a String

Java Program to separate the Individual Characters from a String

by Online Tutorials Library

Java Program to separate the Individual Characters from a String

In this program, we need to separate each character from the string.

CHARACTERS

C H A R A C T E R S

In computer science, collection of characters including spaces is called as string. To separate an individual character from the string, individual characters are accessed through its index.

Algorithm

  • STEP 1: START
  • STEP 2: DEFINE String string = “characters “
  • STEP 3: PRINT “Individual characters from given string: “
  • STEP 4: SET i=0. REPEAT STEP 5 to STEP 6 UNTIL i<string.length()
  • STEP 5: PRINT string.charAt(i)
  • STEP 6: i=i+1
  • STEP 7: END

Program:

Output:

Individual characters from given string:  c h a r a c t e r s  
Next TopicJava Programs

You may also like