StringBuilder

  • Thread starter Thread starter Ken
  • Start date Start date
K

Ken

I'm having an issue with a StringBuilder that is platform dependant.

Given the following two lines:

this.logFileName = new StringBuilder ( Application.ExecutablePath );
this.logFileName = this.logFileName.Replace ( ".exe", ".log" );

It appears that the replace line works on Win2K and XP but does NOT work on
Win98 SE or Windows ME.

Anyone have any ideas as to why?

Thanks in advance for your assistance.

Ken
 
Ken said:
I'm having an issue with a StringBuilder that is platform dependant.

Given the following two lines:

this.logFileName = new StringBuilder ( Application.ExecutablePath );
this.logFileName = this.logFileName.Replace ( ".exe", ".log" );

It appears that the replace line works on Win2K and XP but does NOT work on
Win98 SE or Windows ME.

Anyone have any ideas as to why?

That sounds very, very strange. Could you give a short but complete
example program which demonstrates the issue, and show what it produces
on each of the platforms?
 
I figured it out. The return value of Application.ExecutablePath on Win2K
is mixed case and under Win98 it's all uppercase, hence the replace of lower
case '.exe' does not happen.

Thanks
 
Back
Top