I want to dynamically highlight all substrings that are equal to selected substring inside string str
. Also I want the string str
to be displayed in a nice fashion, say, in a grid of 25 characters per row.
Example:
If I start selecting substring continuously by dragging the mouse over - M, Ma, Mat, Math, Mathe, Mathem, Mathema, Mathemat, Mathemati, Mathematic, Mathematica - I want all substring to highlight with my mouse movement. After I finish selection by releasing mouse button all the substrings remain highlighted by red color. Then I could select another substring this time highlighted with blue color, and so on...
Is it possible to do it in a DynamicModule
?
str = "Mathematica® Stack Exchange is a question and answer site for \
users of Wolfram Mathematica and the Wolfram Language. It's built and \
run by you as part of the Stack Exchange network of Q&A sites. With \
your help, we're working together to build a library of detailed \
answers to every question about Mathematica.";
Partition[Characters[str], 25, 25, {1, 1}, "_"] // Grid
EventHandler
does not seem to be selectable. $\endgroup$