有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!


共 (1) 个答案

  1. # 1 楼答案

    如果比较两个字符串:

    A B C E F H(旧版)
    A C D E G H(新)

    那么您的“脚本”是:

    Keep   'A'
    Delete 'B'
    Keep   'C'
    Insert 'D'
    Keep   'E'
    Delete 'F'
    Insert 'G'
    Keep   'H'
    

    ^{}的javadoc所述:

    When two objects sequences are compared through the StringsComparator.getScript method, the result is provided has a script containing the commands that progressively transform the first sequence into the second one.