String algorithms