Driving me nuts.
Web page calls a function in a different class library that is to return a
string.
Inside this function, I create a string, give it a value, then try to do a
string.replace.
Fails. Though I can do stringname.leng th and get the property, if I try any
of the methods (Replace, Remove, ToUpper, ToLower, etc.), it tells me:
stringname.Repl ace does not exist.
Yet while debugging, I get autocomplete when I type stringname. but still,
no methods 'exist.'
Any ideas?
TIA
jdn ki******@earthl ink.net 4 1535
may we see the actual code, please?
"jdn" <jd*@discussion s.microsoft.com > wrote in message
news:C6******** *************** ***********@mic rosoft.com... Driving me nuts.
Web page calls a function in a different class library that is to return a string.
Inside this function, I create a string, give it a value, then try to do a string.replace.
Fails. Though I can do stringname.leng th and get the property, if I try any of the methods (Replace, Remove, ToUpper, ToLower, etc.), it tells me:
stringname.Repl ace does not exist.
Yet while debugging, I get autocomplete when I type stringname. but still, no methods 'exist.'
Any ideas?
TIA
jdn ki******@earthl ink.net
jdn <jd*@discussion s.microsoft.com > wrote: Web page calls a function in a different class library that is to return a string.
Inside this function, I create a string, give it a value, then try to do a string.replace.
Fails. Though I can do stringname.leng th and get the property, if I try any of the methods (Replace, Remove, ToUpper, ToLower, etc.), it tells me:
stringname.Repl ace does not exist.
Yet while debugging, I get autocomplete when I type stringname. but still, no methods 'exist.'
Any ideas?
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
I don't have the exact code with me, but here's a reproduction:
public string CleanString(Bus inessObject oBusinessObject )
{
string m_TempString = "";
string OldValue = "";
OldValue = oBusinessObject .FunctionToGetO ldValue;
m_TempString = oBusinessObject .StringToClean. Replace(OldValu e, "");
return m_TempString;
}
Where FunctionToGetOl dValue does database stuff, and StringToClean is a
property of the business object.
The .Replace call fails. If I type in ?OldValue in the command window while
debugging, I get the value (which is wrong in itself I think), and I can do
?OldValue.Lengt h fine, but again, if I type in ?OldValue.Repla ce("blahblah",
""), I get the error:
"OldValue.Repla ce" does not exist.
jdn
"Dino Chiesa [Microsoft]" wrote: may we see the actual code, please?
"jdn" <jd*@discussion s.microsoft.com > wrote in message news:C6******** *************** ***********@mic rosoft.com... Driving me nuts.
Web page calls a function in a different class library that is to return a string.
Inside this function, I create a string, give it a value, then try to do a string.replace.
Fails. Though I can do stringname.leng th and get the property, if I try any of the methods (Replace, Remove, ToUpper, ToLower, etc.), it tells me:
stringname.Repl ace does not exist.
Yet while debugging, I get autocomplete when I type stringname. but still, no methods 'exist.'
Any ideas?
TIA
jdn ki******@earthl ink.net http://www.dotnet247.com/247referenc...29/148974.aspx http://blogs.msdn.com/jeff_adkins/ar.../16/73926.aspx
It looked to me like my code wasn't working, but I could have 'fixed' it and
been thrown off by the weird immediate window behavior while debugging. I
will double-check this evening and post back.
But at least, it is a known issue, apparently.
jdn
"jdn" wrote: Driving me nuts.
Web page calls a function in a different class library that is to return a string.
Inside this function, I create a string, give it a value, then try to do a string.replace.
Fails. Though I can do stringname.leng th and get the property, if I try any of the methods (Replace, Remove, ToUpper, ToLower, etc.), it tells me:
stringname.Repl ace does not exist.
Yet while debugging, I get autocomplete when I type stringname. but still, no methods 'exist.'
Any ideas?
TIA
jdn ki******@earthl ink.net This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Chris S. |
last post by:
Is there a purpose for using trailing and leading double underscores for
built-in method names? My impression was that underscores are supposed
to imply some sort of pseudo-privatization, but would using
myclass.len() instead of myclass.__len__() really cause Python
considerable harm? As much as I adore Python, I have to admit, I find
this to be one of the language's most "unPythonic" features and a key
arguing point against Python. I've...
|
by: jdn |
last post by:
Driving me nuts.
Web page calls a function in a different class library that is to return a
string.
Inside this function, I create a string, give it a value, then try to do a
string.replace.
Fails. Though I can do stringname.length and get the property, if I try any
of the methods (Replace, Remove, ToUpper, ToLower, etc.), it tells me:
|
by: Paul Schwann |
last post by:
Hi group,
I am relatively new to C# (although I have a lot of programming
excperience in other languages like Java and C). Currently I am
searching for a solution to this problem:
Suppose you have 3 methods A, B and C. All of them shall be run
threaded (I/O tasks) and one after another. I can create a thread and
schedule one method just like:
|
by: Andrus |
last post by:
I added reference to Microsoft.VisualBasic.dll to project.
Line
var r = Microsoft.VisualBasic.CompilerServices.CompareString("a", "b",
true)<1;
causes compile error:
The type or namespace name 'CompareString' does not exist in the namespace
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |