• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

splitting a string into two variable

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i manage to read a textfile with my program which is a string that looks like this: stuck in a hole in the backyard;60173317358
i want to save stuck in a hole in the backyard in variable x and 60173317358 in variable y. can anyone tell me how to do this? thanks in advance
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Selva Kumar Sundram:
i manage to read a textfile with my program which is a string that looks like this: stuck in a hole in the backyard;60173317358
i want to save stuck in a hole in the backyard in variable x and 60173317358 in variable y. can anyone tell me how to do this? thanks in advance



Have you taken a look at the split() method -- of the String class?

Henry
 
reply
    Bookmark Topic Watch Topic
  • New Topic