• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

string manipulation  RSS feed

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have one string.i have to create a one file and copy the string into that file.how to do this.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This sounds like file manipulation, not String manipulation. To create a file and write to it, you should use either FileOutputStream or FileWriter. See the link to the Java tutorial in my signature for some information about these and other input and output stream classes.

Layne
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to write something on file is called serialization
(your topic could have been "writing a string on file" rather than "string manipulation")
to read/write from files, you need to first import the
java.io package
and then use the classes to open the desired file and write the string at hand onto it.
I think you are new to I/O and I suggest you do a bit of reading before asking for a solution directly. Try searching the I/O forum and make a beginning with the java tutorial.

happy programming
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!