Replacement

struct Replacement

Contains information on how to make a replacement in an original text context.

Example: Assume that we have the text context: “This are a red door” and we applied the following Replacement to it:

  • original: “are”.
  • replacement: “is”.
  • start: 5.
  • end: 9.

Then we would end up with: “This is a red door”.

Summary

Properties
UInt end
The end position in the original text context that is affected by the replacement.
String original
The substring in the original text context that will be replaced by replacement in the range from start to end.
String replacement
The string that should replace original as for the replacement.
UInt start
The start position in the original text context that is affected by the replacement.

Properties

end

let end: UInt

The end position in the original text context that is affected by the replacement.

original

let original: String

The substring in the original text context that will be replaced by replacement in the range from start to end.

replacement

let replacement: String

The string that should replace original as for the replacement.

start

let start: UInt

The start position in the original text context that is affected by the replacement.


If something needs to be added or if you find an error in our documentation, please let us know either on our GitHub or Discord.

Last updated on August 8, 2022