The array is a pretty obvious solution (to me, anyways). But the hash table has an added benefit.
Consider the following string, where   is a non-breaking space:
Main string: "Counter example:  _à²"
Shorter string: "ಠ_ಠ"