Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2007

Tip: Looking for answers? Try searching our database.

ByVal Replacement for String?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lucius - 26 Jun 2007 15:35 GMT
I have a class with a String property. I wonder if there is something
that can hold the same alphanumeric data that is a "byval" class like
an int... Is there?

Thanks.
Patrice - 26 Jun 2007 16:15 GMT
IMO your best bet is to start by explaining what is the problem you are
trying to solve.

I'm not sure to really understand what solution you came up with. It looks
like you are trying to find a string datatype that would be a "value type"
instead of a "reference type" ??? (the byval keyword is still something
else).

--
Patrice

> I have a class with a String property. I wonder if there is something
> that can hold the same alphanumeric data that is a "byval" class like
> an int... Is there?
>
> Thanks.
lucius - 26 Jun 2007 20:12 GMT
Yes, I meant an alphanumeric alternative to String because it is a
"reference type" and I want a "value type".

Thanks and sorry for any confusion.

>IMO your best bet is to start by explaining what is the problem you are
>trying to solve.
[quoted text clipped - 3 lines]
>instead of a "reference type" ??? (the byval keyword is still something
>else).
Jon Skeet [C# MVP] - 26 Jun 2007 20:39 GMT
> Yes, I meant an alphanumeric alternative to String because it is a
> "reference type" and I want a "value type".
>
> Thanks and sorry for any confusion.

What do you intend to achieve using a value type string lookalike?
Strings are immutable, so they can be used almost as if they were value
types in the first place.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet   Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Steven Cheng[MSFT] - 27 Jun 2007 05:07 GMT
Hi Lucius,

Yes, as Jon has said, the .NET framework string type is immutable which
just act like a value type in copy and accessing though it is an reference
type. Would you provide some detail code snippet demonstrate the problem
you meet so that we can get some clear view and dig it further?

http://channel9.msdn.com/ShowPost.aspx?PostID=60365

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.