S
StrandElectric
Thanks Tom for bearing with me! For the first time I feel *slightly*Tom Shelton said:StrandElectric wrote :Right Dan. There are many business applications where a substring is aDanS said:DanS formulated the question :
For instance for the former left there is nothing easier
than
dim x = theString.Substring(0,1) 'Which means one
character starting at the first position, however it can
done in more ways.
But as soon as you know this and like Armin wrote are a
little bit familiar with Net programming, you do for the
former right
dim y = theString.Substring(TheString.Length-10, 10) 'the
last 10 positions.
Yeah, that's far more intuitive and a lot easier to code
than Right$(str,4).
[/sarcasm]
So, add the namespace alias and just do:
Dim y = VB.Right(str,4)
For crying out loud, you only have to do this inside of a
form - and honestly, should you even have this logic there?
I don't see why not....if I've got a form with a text box, and
clicking some button on the form runs some code that uses a
substring of that text in the textbox, where else would you
put that code ?
meanigful part of the solution. Strikes me there is a kind of snobbery at
work here. A simple and logical solution cannot be the right one. It must
be elaborate in concept and if possible execution.
No, it's not snobbery - it's proper design. Yes, it's a little more work
up front, but it saves much time down the road in maintainablity and
extendability.
persuaded. Only slightly, mind you! (but why's 'mid' different?..)