isValid
TypeScriptisValid(text: DiscontiguousAttributedSubstring): booleanSwift declarationfunc isValid(within text: DiscontiguousAttributedSubstring) -> BoolIndicates whether the index is valid for use with the provided discontiguous attributed string. - Parameter text: A discontiguous attributed string used to validate the index. - Returns: `true` when the index is valid for use with the provided discontiguous attributed string; otherwise, false. An index is valid if it is both within the bounds of the discontiguous attributed string and was produced from the provided string without any intermediate mutations.