Streamreader help

C

collinse

**** PLEASE HELP ME ******************************­******
***** SEE BELOW*************************­****************
how can i simply get a string reader into a string that i can modify?
The issue is i can not simply save the readline into a string for
manipulation and output. please help me...





StreamReader* sr = File::OpenText(path);
try {
String *s = "";


int place = 0; // looks for the ID FIELD
String *ID_val = "IAO_"; // ID is the leader if the id
String *ID;
String *temp;
while (s = sr->ReadLine()){
place = s->IndexOf(ID_val);
if ( place == 1)
{
Console::WriteLine(s->Substrin­g(1,8)); //this works
temp = s->Substring(1,8); // this is my problem
}}
// i just want to save the substring as a string.
 
J

Jon Skeet [C# MVP]

**** PLEASE HELP ME ******************************­******
***** SEE BELOW*************************­****************
how can i simply get a string reader into a string that i can modify?
The issue is i can not simply save the readline into a string for
manipulation and output. please help me...

You haven't said what problem you're actually having. Is it failing to
compile, or what?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top