Description:
This function will modify the text contained in the specified Document,
by replacing the specified number of characters at the position
specified by the "position" parameter by the provided string.
This position "position" is the number of characters that have to
be skipped before the characters are replaced by the string,
where the first character of
the Document text has a position equal to 0. If position is lower than
zero, it is treaded as the last character of the Document
text. In the case the last character is specified as position, then
the last "number_of_chars_to_replace" characters are replaced. For example, if I have the
string "This is a test", the following code:
CDM_ByteSequenceReplaceCharacters(Doc, 10, 4, "simple test");
will modify the text of the Document to
"This is a simple test".
The most important aspect of this function is that it will make the
proper arrangements so as the Annotations contained inside the Document
to be displaced by a proper amound of characters so as Annotations
spanning text ranges after the replacement point to span the same text
portions, after the string has replaced the desired characters.
This function will return the new Document text if the replacement was
succesful.
Return Value:
This function will return the new Document text if the replacement was
succesful.
Notes:
This function can be also used in order to delete
characters from the text contained in the specified Document, if the
value of the "string" parameter is an empty string (like "").
In this case, all Annotations objects contained in the specified
Document are searched: if any of them has a Span object in its Span
set whoose offsets span portion of the charactes to be deleted,
then this Span is eliminated from the Span set of the Annotation
object. Note that no Annotation objects are deleted from the Document,
although character deletion can result in Annotations with an empty
Span set. This function is equivelant to CDM_ByteSequenceReplaceCharacters (C++ API).
See Also:
tip_RawDataReplaceCharacters, tip_ByteSequenceInsertString,
tip_DisplaceAnnotations,
tip_GetByteSequence, tip_SetByteSequence,
CDM_ByteSequenceReplaceCharacters
Generated by: petasis@aias on Wed Aug 16 10:31:45 PM EEST 2006.