I think you may try to use the following relevant methods/overloads of the Cells class to find the string in chain of strings, e.g
findStringContains, findStringStartsWith, findStringEndsWith, etc.
Details about the methods:
findStringStartsWith
public Cell findStringStartsWith(java.lang.String inputString, Cell previousCell)
Finds the cell starting with the input string.
Returns null(Nothing) if no cell is found.
Parameters:
inputString - The string to search for.
previousCell - Previous cell with the same string. This parameter can be set to null if seaching from the start.
Returns:
Cell object.
findStringEndsWith
public Cell findStringEndsWith(java.lang.String inputString, Cell previousCell)
Finds the cell ending with the input string.
Returns null(Nothing) if no cell is found.
Parameters:
inputString - The string to search for.
previousCell - Previous cell with the same string. This parameter can be set to null if seaching from the start.
Returns:
Cell object.
findStringContains
public Cell findStringContains(java.lang.String inputString, Cell previousCell)
Finds the cell containing with the input string.
Returns null(Nothing) if no cell is found.
Parameters:
inputString - The string to search for.
previousCell - Previous cell with the same string. This parameter can be set to null if seaching from the start.
Returns:
Cell object.
findStringContains
public Cell findStringContains(java.lang.String inputString, Cell previousCell, boolean isCaseSensitive, CellArea area)
Finds the cell containing with the input string.
Returns null(Nothing) if no cell is found.
Parameters:
inputString - The string to search for.
previousCell - Previous cell with the same string. This parameter can be set to null if seaching from the start.
isCaseSensitive - Indicates if the searched string is case sensitive.
area - Searched area.
Returns:
Cell object.
findStringContains
public Cell findStringContains(java.lang.String inputString, Cell previousCell, boolean isCaseSensitive)
Finds the cell containing with the input string.
Returns null(Nothing) if no cell is found.
Parameters:
inputString - The string to search for.
previousCell - Previous cell with the same string. This parameter can be set to null if seaching from the start.
isCaseSensitive - Indicates if the searched string is case sensitive.
Returns:
Cell object.
Thank you.