Table of Contents

Method FindBreakPositions

Namespace
DocWright.Core.Text
Assembly
DocWright.Core.dll

FindBreakPositions(string, int[])

Finds every position at which word may be broken with a hyphen.

public int FindBreakPositions(string word, int[] destination)

Parameters

word string

The word to hyphenate. Letters and intra-word apostrophes only: a caller that hands over surrounding punctuation shifts every position it gets back.

destination int[]

Receives the break positions in ascending order. A position is the number of characters that stay on the line, so 4 against optimize means opti-mize. Must hold at least word.Length entries.

Returns

int

The number of positions written to destination.

Exceptions

ArgumentNullException

word or destination is null.

ArgumentException

destination is shorter than word.