- strcmp / strcmpi
- contains
- strfind
- regexp
- ismember
Compare strings and indicate differences by color in GUI
2 次查看(过去 30 天)
显示 更早的评论
Hi all,
I haven't been able to find a solution to the following: I would like to compare two strings and show the differences between them in AppDesigner through changing color of the letters that differ.
Does someone know if this is possible and how to do it?
4 个评论
Adam Danz
2019-9-27
编辑:Adam Danz
2019-9-27
Changing colors wtihin a string is typically done with a tex interpreter. Unfortunately there is no interpreter property of GUI textboxes.
You'll need to print the string on an object that has an interpreter property like an axis or an annotation object. Here's an example.
fh = figure();
str = ['\fontsize{16}black {\color{magenta}magenta ','\color[rgb]{0 .5 .5}teal \color{red}red} black again'];
annotation(fh,'textbox','String',str, 'FontSize',25,'Interpreter','Tex');
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Standard File Formats 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!