Earth Engine 已推出
非商業用途的配額級別,以便保護共用運算資源,並確保所有使用者都能享有穩固效能。非商業用途的專案預設會使用「社群」級別,但您隨時可以變更專案級別。
Google 會運用 AI 技術將內容翻譯成您偏好的語言,但可能會出錯。
ee.String.length
透過集合功能整理內容
您可以依據偏好儲存及分類內容。
傳回字串長度。
| 引數 | 類型 | 詳細資料 |
|---|
這個:string | 字串 | 要取得長度的字串。 |
範例
程式碼編輯器 (JavaScript)
print(ee.String('').length()); // 0
print(ee.String('abc123').length()); // 6
Python 設定
請參閱
Python 環境頁面,瞭解 Python API 和如何使用 geemap 進行互動式開發。
import ee
import geemap.core as geemap
Colab (Python)
display(ee.String('').length()) # 0
display(ee.String('abc123').length()) # 6
[null,null,["上次更新時間:2025-10-30 (世界標準時間)。"],[],["The `String.length()` method calculates the number of characters in a string. It takes a string as input (`this: string`) and returns an integer representing the string's length. For example, an empty string returns a length of 0, while the string 'abc123' returns a length of 6. This function can be used in both JavaScript and Python (using the `ee` library and `geemap`).\n"]]