#Help i need explain and example

1 messages · Page 1 of 1 (latest)

calm gustBOT
#

<@&987246399047479336> please have a look, thanks.

scarlet kayak
#

uh?

#

what is your question?

#

and what is:

mid (S,n1,n2)
#

?

#

pls share the whole context

graceful egret
#

And could you share what you've written? At first glance you want a substring and are passing in a start and end index?

neat hare
#

Mid(S, 3, 2) S=Thomas
the answer is "om"

graceful egret
#

So it creates a substring of Thomas, starting at the third character (o), and of length 2.

neat hare
#

but the explain is "returns a set of n2 characters starting at n1 in the string S"

#

i don't what is the meaning

graceful egret
#

that's what I said

#

n2 = 2
n1 = 3
Thomas
1234567
--**----

neat hare
#

if mid(S, 3, 5) with S = "Thomas" and mid(S, 2, 3) with S = "Thomas"

graceful egret
#

I'd expect the first one to give an indexoutofboundsexception