Class: QgsStringReplacement¶
A representation of a single string replacement.
Methods
Returns |
|
Returns the string matched by this object |
|
Processes a given input string, applying any valid replacements which should be made. |
|
Returns a map of the replacement properties. |
|
Returns the string to replace matches with |
|
Returns |
Static Methods
Creates a new |
- class qgis.core.QgsStringReplacement[source]¶
Bases:
object
- __init__(match: str | None, replacement: str | None, caseSensitive: bool = False, wholeWordOnly: bool = False)
Constructor for QgsStringReplacement.
- Parameters:
match (Optional[str]) – string to match
replacement (Optional[str]) – string to replace match with
caseSensitive (bool = False) – set to
True
for a case sensitive matchwholeWordOnly (bool = False) – set to
True
to match complete words only, orFalse
to allow partial word matches
- __init__(a0: QgsStringReplacement)
- Parameters:
a0 (QgsStringReplacement)
- static fromProperties(properties: Dict[str | None, str | None]) QgsStringReplacement [source]¶
Creates a new
QgsStringReplacement
from an encoded properties map.See also
- Parameters:
properties (Dict[Optional[str], Optional[str]])
- Return type:
- process(self, input: str | None) str [source]¶
Processes a given input string, applying any valid replacements which should be made.
- Parameters:
input (Optional[str]) – input string
- Return type:
str
- Returns:
input string with any matches replaced by replacement string