Example usage for com.google.common.base Strings commonSuffix

List of usage examples for com.google.common.base Strings commonSuffix

Introduction

In this page you can find the example usage for com.google.common.base Strings commonSuffix.

Prototype

public static String commonSuffix(CharSequence a, CharSequence b) 

Source Link

Document

Returns the longest string suffix such that a.toString().endsWith(suffix) && b.toString().endsWith(suffix) , taking care not to split surrogate pairs.

Usage

From source file:tech.tablesaw.columns.strings.StringMapFunctions.java

default StringColumn commonSuffix(Column<?> column2) {

    StringColumn newColumn = StringColumn.create(name() + column2.name() + "[suffix]");

    for (int r = 0; r < size(); r++) {
        String value1 = getString(r);
        String value2 = column2.getString(r);
        newColumn.append(Strings.commonSuffix(value1, value2));
    }/*from w  w  w  .j  ava  2s.  co  m*/
    return newColumn;
}