<-- Previous || Up || Next -->

Combine Overlapping Words Function
String Words Class

Public Function CombineOverlappingWords( _
      ByVal vLineOne As Variant _
    , ByVal vLineTwo As Variant _
    ) As Variant

Combine words that overlap from the end of one phrase to the beginning of the other.

Examples:
    CombineOverlappingWords("THIS IS A", "A STRING") = "THIS IS A STRING"
    CombineOverlappingWords("THIS IS A", "IS A STRING") = "THIS IS A STRING"
    CombineOverlappingWords("THIS IS", "A TEST") = "THIS IS A TEST"
    CombineOverlappingWords("THIS  IS A", "A STRING") = "THIS  IS A STRING" ' #4
See also:
    SortWords Function
    UniqueCharacters Function
    UniqueFileLines Function
Function returns Null if both vLineOne and vLineTwo are Null.

vLineOne: The left portion of the phrase whose right side is to be checked against the left side of vLineTwo. vLineOne defaults to an empty string if it is Null or cannot be fixed up to a String.

vLineTwo: The right portion of the phrase whose left side is to be checked against the left side of vLineOne. vLineTwo defaults to an empty string if it is Null or cannot be fixed up to a String.

Note: The combined phrases are separated by a single space, even though all other spaces in the non-overlapping portions of the two phrases are preserved as in example #4.
Note: Function uses the built-in character classification routines to determine which characters represent spaces.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.