Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 186

Finding words that start and end with same letter

$
0
0

Why does this code run too slow?

SameStartEndWords[char_String] :=  Table[If[{First[Characters[WordList[][[i]]]]} == Characters[char] &&  {Last[Characters[WordList[][[i]]]]} == Characters[char], WordList[][[i]], ## &[]], {i,  Length[WordList[]]}

I am trying to create a list of words from WordList[] that start and end with a specified letter "char". How could I make this more efficent?


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>