How do you call a subsequence of consecutive elements ? I wrote a function that returns the position of a given subsequence in a sequence. However, I just realized that I used the term "subsequence" incorrectly: according to Wikipedia, the elements of a subsequence don't need to be consecutive. But my function is actually looking for a "subsequence of consecutive elements"... is there a name for this notion? I thought of substring, but it seems to imply a sequence of characters, and my function is not specific to character strings..

I realize it isn't a very critical issue, but I'd like to give my function an accurate name...

Any idea would be appreciated !
In programming languages and libraries, it is usually called either a substring or a slice.

The former term is ubiquitous, and I would not mind using it even if your "characters" are a bit weird.

The latter term is neutral in the sense that it does not refer to strings. See array slicing in Wikipedia for more information and examples.