お知らせ :
2025 年 4 月 15 日 より前に Earth Engine の使用を登録したすべての非商用プロジェクトは、Earth Engine へのアクセスを維持するために
非商用目的での利用資格を確認 する必要があります。
フィードバックを送信
ee.String.split
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
正規表現で文字列を分割し、文字列のリストを返します。
用途 戻り値 String. split (regex, flags )
リスト
引数 タイプ 詳細 これ: string
文字列 分割する文字列。 regex
文字列 分割する正規表現。正規表現が空の文字列の場合、入力文字列は個々の文字に分割されます。 flags
文字列、デフォルト: "" 正規表現フラグを指定する文字列: 'i'(大文字と小文字を区別しない)。
例
コードエディタ(JavaScript)
var s = ee . String ( 'aBAbcD' );
print ( s . split ( 'Ab' )); // ["aB","cD"]
// 'i' tells split to ignore case.
print ( s . split ( 'ab' , 'i' )); // ["","","cD"]
// Split on 'b' or 'c'
print ( s . split ( '[bc]' , 'i' )); // ["a","A","","D"]
// Split on 'BA' or 'c'
print ( s . split ( '(BA|c)' )); // ["a","b","D"]
var s = ee . String ( 'a,b,cdee f,g' );
// ["a",",","b",",","c","d","e","e"," ","f",",","g"]
print ( s . split ( '' ));
print ( s . split ( ' ' )); // ["a,b,cdee","f,g"]
print ( s . split ( '[[:space:]]' )); // ["a,b,cdee","f,g"]
print ( s . split ( ',' )); // ["a","b","cdee f","g"]
print ( s . split ( 'ee' )); // ["a,b,cd"," f,g"]
// Split on any lower case letter.
print ( s . split ( '[a-z]' )); // ["",",",",","","",""," ",","]
// ^ as the first character in [] excludes.
print ( s . split ( '[^a-z]' )); // ["a","b","cdee","f","g"]
// Splitting on characters that are special to split.
var s = ee . String ( 'a.b*c?d' );
print ( s . split ( '\\.' )); // ["a","b*c?d"]
print ( s . split ( '[*]' )); // ["a.b","c?d"]
print ( s . split ( '[?]' )); // ["a.b*c","d"]
Python の設定
Python API とインタラクティブな開発での geemap
の使用については、
Python 環境 のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
s = ee . String ( 'aBAbcD' )
print ( s . split ( 'Ab' ) . getInfo ()) # ['aB', 'cD']
# 'i' tells split to ignore case.
print ( s . split ( 'ab' , 'i' ) . getInfo ()) # ['', '', 'cD']
# Split on 'b' or 'c'
print ( s . split ( '[bc]' , 'i' ) . getInfo ()) # ['a', 'A', '', 'D']
# Split on 'BA' or 'c'
print ( s . split ( '(BA|c)' ) . getInfo ()) # ['a', 'b', 'D']
s = ee . String ( 'a,b,cdee f,g' )
# ['a', ',', 'b', ',', 'c', 'd', 'e', 'e', ' ', 'f', ',', 'g']
print ( s . split ( '' ) . getInfo ())
print ( s . split ( ' ' ) . getInfo ()) # ['a,b,cdee', 'f,g']
print ( s . split ( '[[:space:]]' ) . getInfo ()) # ['a,b,cdee', 'f,g']
print ( s . split ( ',' ) . getInfo ()) # ['a', 'b', 'cdee f', 'g']
print ( s . split ( 'ee' ) . getInfo ()) # ['a,b,cd', ' f,g']
# Split on any lower case letter.
print ( s . split ( '[a-z]' ) . getInfo ()) # ['', ',', ',', '', '', '', ' ', ',']
# ^ as the first character in [] excludes.
print ( s . split ( '[^a-z]' ) . getInfo ()) # ['a', 'b', 'cdee', 'f', 'g']
# Splitting on characters that are special to split.
s = ee . String ( 'a.b*c?d' )
print ( s . split ( ' \\ .' ) . getInfo ()) # ['a', 'b*c?d']
print ( s . split ( '[*]' ) . getInfo ()) # ['a.b', 'c?d']
print ( s . split ( '[?]' ) . getInfo ()) # ['a.b*c', 'd']
フィードバックを送信
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンス により使用許諾されます。コードサンプルは Apache 2.0 ライセンス により使用許諾されます。詳しくは、Google Developers サイトのポリシー をご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-26 UTC。
ご意見をお聞かせください
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-26 UTC。"],[[["`String.split()` divides a string into a list of substrings based on a provided regular expression."],["The function accepts an optional `flags` argument, supporting 'i' for case-insensitive splitting."],["If the regular expression is an empty string, the input string is split into individual characters."],["Special characters within the regular expression can be escaped using a backslash."]]],[]]