ee.String

  • The ee.String() constructor creates a new Earth Engine String object.

  • It takes an object or a string as an argument.

  • The constructor returns an Earth Engine String object.

  • Earth Engine Strings can include emoji and can be empty.

Constructs a new String.

UsageReturns
ee.String(string)String
ArgumentTypeDetails
stringObject|StringA string or a computed object.

Examples

Code Editor (JavaScript)

print(ee.String('I am a string'));  // I am a string

// Strings can use emoji.
print(ee.String('🧲⚡️👀'));  // 🧲⚡️👀

// Empty string.
var empty = ee.String('');
print(empty);  // ''
print(empty.length());  // 0

Python setup

See the Python Environment page for information on the Python API and using geemap for interactive development.

import ee
import geemap.core as geemap

Colab (Python)

display(ee.String('I am a string'))  # I am a string

# Strings can use emoji.
display(ee.String('🧲⚡️👀'))  # 🧲⚡️👀

# Empty string.
empty = ee.String('')
display(empty)  # ''
display(empty.length())  # 0