The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

String::CyclicRotation - Checks if a string is a cyclic rotation of another string.

SYNOPSIS

    use String::CyclicRotation qw(is_rotation);
    my $res = is_rotation("table", "ablet"); #true

DESCRIPTION

Checks if a string is a cyclic rotation of another string. This test is done in O(n).

METHODS

is_rotation

Checks if a string is a cyclic rotation of another string.

More Information

You can check more information about the used algorithm in the book "Algorithms on strings, trees and sequences".

Author

João Carreira, <joao.carreira@ist.utl.pt>

COPYRIGHT & LICENSE

Copyright 2009 João Carreira, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.