Question
I would like to know what notation can be used to represent the intersection of two strings.
First things first
When I say string I refer to a sequence of characters in computer science ("EXAMPLE") for instance.
When I say substring I mean a consecutive piece of the initial string ("AMPLE") for instance would be a substring of the first example string. I say this to clarify that I'm not talking about subsequences which would mean that "XMLE" would be valid subsequence but not a substring.
What I'm trying to write
If I have two strings $N$ and $M$. I want to find if the substring $N_{15}$ (this is how I denoted from character position 1 to 5) is in $M$. If yes, take the length of the substring $|N_{15}|$ (I used the notation for set cardinality here) else the length is $0$.
What I wrote
For given $i, j$ I wrote $|N_{ij} \cap M|$ trying to say that if $N_{i, j} \in M$ the intersection would be of cardinality $|N_{i, j}|$ and zero otherwise.
My worries
I am worried that if somebody looks at $N$ and $M$ as sets (or even general sequences) this won't make much sense and it might not be clear. I can write the equation and clarify within a few sentences just like here as of what I've meant but at this point I'd like to consult with somebody mathematically more literate than me.
Another worry is that if somebody looks at $N$ and $M$ as sets $N_{ij}$ would be viewed as the element in a cartesian product which would further confuse the reader.