Since you are only worried about words (for example, tokens separated by spaces), you can simply break the spaces and see how often "hello"
appears. Since you did not specify a language, the implementation in Perl is implemented here:
use strict; use warnings; my $a1="ehello goodbye hellot hello goodbye"; my $a2="ehello goodbye hello hello goodbye"; my @arr1=split(/\s+/,$a1); my @arr2=split(/\s+/,$a2);
Output signal
1, 2
user554546
source share