I work now a lot with strings of characters and other finite sequences and found that I need many times a good notation for "cutting the end" a string. If $a$ is a finite sequence and $a'$ is its right end, then there is a sequence $x$ such that $a = x a'$ (where the product is defined by concatenation). What I would like to have is a suggestive notation for $x$: $x$ might be $a$ "minus" $a'$, or $a$ "divided by $a'$, if we view the set of all strings as a semigroup. I have therefore thought of writing $x$ as $a / a'$ but am not completely happy with it. Obvoiusly I need also a notation for "cutting at the left end"; by continuing with the previous idea the notation $a' \setminus a$ could stand for the solution of $a = a' x$, but it collides a bit with the notation for set difference.

So far I have thought, and my question is: Is there a good notation for these concepts already in use in some areas of mathematics or computer science, or has someone else already defined a suggestive notation?

*P.S.* And I also would like to have a notation for the "overlapping concatenation" of strings: If $a = a'x$ and $b = xb'$, what is $a'xb'$?

**Addition, 2014:**

After reading the answers so far, and not being satisfied with them, I came up with the following scheme:

*Right ends:*If $a = a' x$, then I write $a \mathrel{//} x$ to express that $x$ appears at the right end of $a$. I also write $a' = a / x$ for the result of cutting $x$ from the right end of $a$.*Left ends:*If $a = x a'$, then I write $x \mathrel{\backslash\backslash} a$ to express that $x$ appears at the left end of $a$. I also write $a' = x \setminus a$ for the result of cutting $x$ from the left end of $a$.*Overlapping product:*If $a = a'x$ and $b = x b'$ (or $a \mathrel{//} x \mathrel{\backslash\backslash} b$ in the new notation), then $a' x b' = a \mathbin{\langle x\rangle} b$.

The result is a workable notation and aesthetically pleasing (at least for me).

subwords(orfactors) of $a$, $x$ is aprefixof $a$, and $a'$ is asuffixof $a$. If $x$ is not empty, then it is aproper prefixof $a$. – Joel Reyes Noche Apr 13 '12 at 10:58