Post Reply 
Another question from a newbie
10-25-2019, 05:53 AM
Post: #2
RE: Another question from a newbie
There is a misunderstanding here of what the second argument means. It is not a pointer to a position within the string, but a count of how many characters should be returned, with the counting starting from the right end of the input string.

RIGHT("abcdefg",2) returns "fg" because those are the rightmost two character of the input string.

RIGHT("MOMOGUMBO",5) returns "GUMBO" not because 5 points to the 5th character in the input, but because "GUMBO" is the rightmost 5 characters of the input.

And that's why
RIGHT("MOMOGUMBO",1) returns "O", and
RIGHT("MOMOGUMBO",2) returns "BO", and so on.
RIGHT("MOMOGUMBO",9) returns all 9 characters of the input, as it should.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Another question from a newbie - DrDarius - 10-25-2019, 02:21 AM
RE: Another question from a newbie - Joe Horn - 10-25-2019 05:53 AM



User(s) browsing this thread: 1 Guest(s)