Overlap - Maple Help

# Online Help

###### All Products    Maple    MapleSim

StringTools

 Overlap
 compute the overlap of two strings

 Calling Sequence Overlap( s, t )

Parameters

 s - string t - string

Description

 • The Overlap(s,t) command computes the length of the overlap between s and t in linear time. This is defined to be the length of the longest suffix of s that is a prefix of t.
 • Note that, in general, Overlap( s, t ) and Overlap( t, s ) are different.
 • All of the StringTools package commands treat strings as (null-terminated) sequences of $8$-bit (ASCII) characters.  Thus, there is no support for multibyte character encodings, such as unicode encodings.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Overlap}\left("abc","def"\right)$
 ${0}$ (1)
 > $\mathrm{Overlap}\left("abc","cdef"\right)$
 ${1}$ (2)
 > $\mathrm{Overlap}\left("abcdef","defg"\right)$
 ${3}$ (3)

 See Also