[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

reading a single string

Hi,
I know readLine read in string and can be splted,
how can i read in a sigle at a time:
example if i have firstString secondString
How do i read them and need to split after

Thanks
0
komlaaa
Asked:
komlaaa
  • 2
2 Solutions
 
objectsCommented:
while (null!=(line=in.readLine()))
{
   String[] split = line.split(" ");
   ...
}
0
 
zzynxSoftware engineerCommented:
If you don't want to use readLine() + split, you'll have to read character by character using read().
Then your string stops whenever you encounter a space (in your case)
0
 
zzynxSoftware engineerCommented:
Thanks
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now