geetools.String.StringAccessor.format#
- geetools.String.StringAccessor.format(template)#
Format a string with a dictionary.
Replace the keys in the string using the values provided in the dictionary. Follow the same pattern: value format as Python string.format method.
- Parameters:
template (geetools.types.ee_dict) – A dictionary with the values to replace.
- Returns:
The formatted string.
- Return type:
ee.String
Examples
import ee, geetools ee.Initialize() s = ee.String("{greeting} {name} !").geetools.format({"greeting": "Hello", "name": "bob"}) s.getInfo()