473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

System.String stopped working

In my method I tried to manipulate a string parameter using IndexOf()
method -- even though it compiles all the string methods (IndexOf,
Trim, UpperCase....) fail -- except the property Length. The strange
thing is neither compiler or run-time system generates any error:
static string ServerUrl(string server, string port, string resource)
{
// server.Length would return the correct length of string... but...

int x = server.IndexOf("/");
// x is "out of scope" when putting breakpoint here...

if(x == -1)
{
return string.Format("http://{0}:{1}/{2}", server, port, resource);
}

// execution continues without any error...

string[] parts = server.Split('/');

return string.Format("http://{0}:{1}/{2}/{3}", parts[0], port,
parts[1], resource);
}

Any ideas?

Mar 13 '06 #1
2 1511
le***********@gmail.com wrote:
In my method I tried to manipulate a string parameter using IndexOf()
method -- even though it compiles all the string methods (IndexOf,
Trim, UpperCase....) fail -- except the property Length. The strange
thing is neither compiler or run-time system generates any error:


So in what way do they "fail"?

Leaving the debugger aside, can you post a short but complete program
that demonstrates the problem? See
http://www.pobox.com/~skeet/csharp/complete.html for what I mean by
that.

Jon

Mar 13 '06 #2
Found the reason they 'fail' -- i.e. variable doesn't contain the
desired data.

The reason it was "out of scope" was because the debugger was actually
debugging another version of executable. For some reason the modified
source code didn't get compiled but the code is pretty close to the
original VS still allows setting breakpoints etc. on the modified code.
That's why new variables don't display in the debugger...

Thanks for the info though... the problem solved itself :)

Mar 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin | last post by:
Hi, I need some help on reading commaseparated strings into arrays as numbers. When I use $data = "12.4,11.3,13.2"; $myarray = explode(',',$data); I get strings, not numbers:. ...
2
by: Dag Sunde | last post by:
I have the following code fragment in one of my pages: if (typeof document.getElementById('myApplet').getTableAsSDV != 'undefined') { rowBuffer =...
11
by: ptass | last post by:
Hi I've installed win2k3 sp1 on a machine where an openRead on any given file was previously working. After installation, I get a webException as follows... ..message "An exception occurred...
13
by: Alexandra | last post by:
Hi, I have a hidden system file that I need to read. I am logged in as an administrator. I can not change the file attributes using the windows explorer.
1
by: solex | last post by:
Hello All, Hopefully someone has run into this error. I have written a class(source below) that launches a thread to monitor the StandardOutput of a System.Diagnostics.Process, in particular I...
2
by: Doug | last post by:
I've installed ASP.NET onto our web server (Win2k/unsure of IIS version) this morning. I created a simple ASPX page in Notepad that writes out an asp:Label control to the page and dynamically...
2
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. ...
20
by: djc | last post by:
I get this *intermittently* on a utility I am working on. I don't know whats going on but here are a few points about it: - using VS 2005, running on xp sp2 - program uses multiple threadpool...
4
by: Max | last post by:
hi i have file browser control to select any file and a button to upload file on my web page now when i select any file. now on click of upload button i have check that file exist or no if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.