RosettaCodeData/Task/Rep-string/Maple/rep-string-1.maple

9 lines
171 B
Plaintext

repstr? := proc( s :: string )
local per := StringTools:-Period( s );
if 2 * per <= length( s ) then
true, s[ 1 .. per ]
else
false, ""
end if
end proc: