Method FindBreakPositions
FindBreakPositions(string, int[])
Finds every position at which word may be broken with a hyphen.
public int FindBreakPositions(string word, int[] destination)
Parameters
wordstringThe word to hyphenate. Letters and intra-word apostrophes only: a caller that hands over surrounding punctuation shifts every position it gets back.
destinationint[]Receives the break positions in ascending order. A position is the number of characters that stay on the line, so
4againstoptimizemeansopti-mize. Must hold at leastword.Lengthentries.
Returns
- int
The number of positions written to
destination.
Exceptions
- ArgumentNullException
wordordestinationis null.- ArgumentException
destinationis shorter thanword.