Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find the characters common to multiple strings
| ResourceFunction["StringIntersection"][s1,s2,…] gives a string containing the characters common to all the si. | 
Find characters in one string that are also in another:
| In[1]:= | ![ResourceFunction["StringIntersection"]["Hello", "World"]](https://www.wolframcloud.com/obj/resourcesystem/images/240/240535c8-616e-443b-990b-13e2a4a9d2f5/1677e1366be74968.png) | 
| Out[1]= |  | 
Use several strings:
| In[2]:= | ![ResourceFunction[
 "StringIntersection"]["Which of the characters are common?", "Some of these", "And some of these", "Don't forget these"]](https://www.wolframcloud.com/obj/resourcesystem/images/240/240535c8-616e-443b-990b-13e2a4a9d2f5/6604e5ec1227d0ab.png) | 
| Out[2]= |  | 
All characters are supported:
| In[3]:= | ![{str1, str2} = TextCases[ResourceData["The Odyssey - Greek"], "Sentence"][[1 ;; 2]]](https://www.wolframcloud.com/obj/resourcesystem/images/240/240535c8-616e-443b-990b-13e2a4a9d2f5/68f5eff71f7e73e1.png) | 
| Out[3]= |  | 
| In[4]:= | ![ResourceFunction["StringIntersection"][str1, str2]](https://www.wolframcloud.com/obj/resourcesystem/images/240/240535c8-616e-443b-990b-13e2a4a9d2f5/30fe088ac1d8fb5d.png) | 
| Out[4]= |  | 
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License