Equiv to Left$, Mid$ and Right$

Reply Forum
Forum postRoger Howlett @ 2009-07-29 12:31:47
ReplyReply to
Hi
I am entirely new to C# but have many years experience in Basic programming.

I was wondering if C# has an equivalent to Left$, Mid$ and Right$.

The reason I am asking is because I intend to convert a program I wrote many years ago in Spectrum Basic. I have successfully converted this programs to other forms of basic and it uses Left$, Right$ and mid$.

Any help would be appreciated


Forum postWebmaster @ 2009-07-30 08:58:37
ReplyReply to
Hi Roger,

As far as I can see, C# doesn't have the exact same functions as those found in Basic. The SubString method of the String class is probably as close as it gets, but it's not totally the same. However, you can probably find user-written alternatives, like this one: http://dev1.wordpress.com/2007/08/31/left-right-and-mid-functions-in-c/. I haven't tested them, but they seem to do what you want. Have a look and see if they can help you :)











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com