Linked Questions

0 votes
2 answers
240 views

help with StringJoin [duplicate]

dollarWon := 100 "(" <> Style["$" <> ToString[dollarWon], If[dollarWon >= 0, Darker[Green], Red]] <> ")" I am getting an error: String ...
dabd's user avatar
  • 839
3 votes
1 answer
314 views

How to create a multicolored string? [duplicate]

I'm interested in displaying a string composed from sub-strings of different colors. Mathematica allows one to create a list comprising sub-strings of different colors, for example ...
Konstantin's user avatar
1 vote
2 answers
173 views

Colorize letters in the given string [duplicate]

How can I colorize letters in the given string? For instance: string = "jaonvtaqhsy" How to colorize 3 letters in the middle of ...
vito's user avatar
  • 9,076
0 votes
0 answers
146 views

How to highlight a string pattern? [duplicate]

This is an example in the help pages (Working with patterns: Highlight Patterns): ...
HyperGroups's user avatar
  • 8,649
0 votes
0 answers
36 views

Join styled and normal string and keep formating [duplicate]

I have a styled and a normal string and I want to join them. However, it seems that the styled object doesn't have the structure of a string and so they cannot be joined. I can do it with Print but I ...
Veliko's user avatar
  • 349
55 votes
4 answers
4k views

Visualizing the difference between two sequences (strings)

I'm trying to develop a way of comparing two sequences (probably originally text, such as text writing or source code, possibly converted to lists). As a familiar example, consider the revisions ...
cormullion's user avatar
  • 24.3k
21 votes
1 answer
3k views

How to strip all formatting from a string and convert it to plain text?

The documentation on String states: But if I try to perform some manipulations on this string, for example, take 2 words from the left, I get some shards of ...
Լ.Ƭ.'s user avatar
  • 333
19 votes
3 answers
1k views

Highlighting pattern strings in a large text

I would like to apply Style to strings that are matched, for example, with one or more specified patterns or regular expressions, a string or a list of both, ...
Jonathan Prieto-Cubides's user avatar
8 votes
3 answers
1k views

How to change the word's color in string

The picture I load is my target: This is my code in mathematica ...
yode's user avatar
  • 27.2k
6 votes
3 answers
930 views

Highlighting text with StringReplacePart but also using Style, Subscript

For a Natural Language Processing analysis task it's desirable to highlight a text string programmatically according to XML tags that reference specific words or phrases. The XML tags specify the ...
alancalvitti's user avatar
  • 15.2k
5 votes
2 answers
307 views

Character display color

I'm looking to cause the front end to display individual characters in a specific color, just in general, as a default sort of thing. For instance, the character "1" would always display as a red 1, ...
mystackexchangeusername's user avatar
6 votes
3 answers
436 views

Italic style in the label

For the FrameLabel, I have: Style["\[NumberSign] Humans per city", FontFamily -> "Latin Modern Math"] How can I make only "Humans" ...
user avatar
3 votes
3 answers
2k views

How do I make a single character bold?

I have a string of characters, like "CDABOZPVRYXSWQEGNILUTHMKJF" and want to convert it to a string in which the character at position ...
orome's user avatar
  • 12.9k
2 votes
3 answers
441 views

Visualizing Base-10 Digits (0-9) As Corresponding Colors

Is there a way I can visualize my output (which happens to be in base-10 by default) with a specific color text corresponding to the digit (0 through 9)? Here is the key for the coloring scheme: 0: ...
Travis Arlen McCracken's user avatar
3 votes
2 answers
867 views

Highlighting or coloring certain words / substrings appearing in a larger string

I have one longer string, longString, and a set $S$ of shorter strings {ss1,ss2,ss3,...}. I'd like to print out ...
Bob2Alice's user avatar
  • 127
3 votes
1 answer
183 views

How to use a variable within StringJoin

I would like Mathematica to symbolically line up partial derivative symbol with a value stored in variable. I wrote this simple code below ...
PatStarks's user avatar
0 votes
1 answer
59 views

Typing custom plotlegend

I have the following ListStepPlot: ...
Gae P's user avatar
  • 657