How to get a consecutive same set of character from the string which are stored in array ? For example' INPUT: sword|word|cord output: ord : <p>how to get consecutive set of character from a string which are stored in a array?
for example:
input:
sword
cord
word
OUTPUT:
ord</p>
