473,401 Members | 2,139 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,401 software developers and data experts.

method allias

hy,
i m looking for define a method alias in c#
RTrim and LTrim doesnt exists... and we need to use TrimStart TrimEnd so....
how define a alias

public string RTrim = public string TrimStart ?
Mar 21 '06 #1
5 6577
> hy,
i m looking for define a method alias in c#
RTrim and LTrim doesnt exists... and we need to use TrimStart TrimEnd
so....
how define a alias
public string RTrim = public string TrimStart ?


Won't work.

You can alias a type, but not a method.

Why can't you just use TrimStart and TrimEnd instead?

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Mar 21 '06 #2

"Lasse Vågsæther Karlsen" <la***@vkarlsen.no> a écrit dans le message de
news: a0*************************@news.microsoft.com...
hy,
i m looking for define a method alias in c#
RTrim and LTrim doesnt exists... and we need to use TrimStart TrimEnd
so....
how define a alias
public string RTrim = public string TrimStart ?

Won't work.

You can alias a type, but not a method.


pfffff :( - viva el open source ;)


Why can't you just use TrimStart and TrimEnd instead? yes... no problem... its just "a dream" to uniformize the different C#
language... (vb, c#, etc ... php...)

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2

Mar 21 '06 #3
On Tue, 21 Mar 2006 11:33:02 +0100, Steph wrote:

Why can't you just use TrimStart and TrimEnd instead?

yes... no problem... its just "a dream" to uniformize the different C#
language... (vb, c#, etc ... php...)


You can't define an alias of a function in C# but if using TrimStart really
bothers you that much and unless the class you're working on is sealed,
nothing prevents you from deriving from this class and wrapping the call to
TrimStart() in a fonction called LTrim().
Mar 21 '06 #4
Steph wrote:
Why can't you just use TrimStart and TrimEnd instead?

yes... no problem... its just "a dream" to uniformize the different C#
language... (vb, c#, etc ... php...)


If you do that, you end up with code that only one person can
understand - you. If you use TrimStart and TrimEnd, then any .NET
programmer will be able to understand it.

Jon

Mar 21 '06 #5
> "Lasse Vågsæther Karlsen" <la***@vkarlsen.no> a écrit dans le message
de news: a0*************************@news.microsoft.com...
hy,
i m looking for define a method alias in c#
RTrim and LTrim doesnt exists... and we need to use TrimStart
TrimEnd
so....
how define a alias
public string RTrim = public string TrimStart ? Won't work.

You can alias a type, but not a method.

pfffff :( - viva el open source ;)


And specifically, which open source version of C# allows you to alias a method?
Why can't you just use TrimStart and TrimEnd instead?

yes... no problem... its just "a dream" to uniformize the different C#
language... (vb, c#, etc ... php...)


"Uniformize" how? If the languages all use .NET then they can all use .TrimStart
and .TrimEnd. IMO they're already "uniformized".

--
Lasse Vågsæther Karlsen
http://usinglvkblog.blogspot.com/
mailto:la***@vkarlsen.no
PGP KeyID: 0x2A42A1C2
Mar 22 '06 #6

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

Similar topics

11
by: Dave Rahardja | last post by:
OK, so I've gotten into a philosophical disagreement with my colleague at work. He is a proponent of the Template Method pattern, i.e.: class foo { public: void bar() { do_bar(); } protected:...
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
4
by: daniel.w.gelder | last post by:
I wrote a template class that takes a function prototype and lets you store and call a C-level function, like this: inline string SampleFunction(int, bool) {..} functor<string (int, bool)>...
7
by: greenflame | last post by:
I am trying to make a matrix object. I have given it some properites. I am trying to add a method. When I call the method by Test.showDims(...) I want to only enter one input, that is the method by...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
10
by: Mihai Osian | last post by:
Hi everyone, Given the code below, can anyone tell me: a) Is this normal behaviour ? b) If it is, what is the reason behind it ? I would expect the A::method(int) to be inherited by B. ...
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
3
by: allendowney | last post by:
Hi All. In a complex inheritance hierarchy, it is sometimes difficult to find where a method is defined. I thought it might be possible to get this info from the method object itself, but it...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
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,...
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.