Class OpenHighlight

java.lang.Object
cloud.opencode.base.string.text.OpenHighlight

public final class OpenHighlight extends Object
Text Highlight Utility - Provides text highlighting methods. 文本高亮工具 - 提供文本高亮方法。

Features | 主要功能:

  • HTML span highlighting with CSS class - HTML span高亮带CSS类
  • ANSI console color highlighting - ANSI控制台颜色高亮
  • Custom prefix/suffix highlighting - 自定义前缀/后缀高亮
  • Multi-keyword highlighting - 多关键词高亮

Usage Examples | 使用示例:

String html = OpenHighlight.highlightHtml("Hello World", "World");
// "Hello <span class=\"highlight\">World</span>"

Security | 安全性:

  • Thread-safe: Yes (stateless utility) - 线程安全: 是(无状态工具类)
  • Null-safe: Yes (returns input for null keyword) - 空值安全: 是
Since:
JDK 25, opencode-base-string V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also: