ঘোষণা :
15 এপ্রিল, 2025 এর আগে আর্থ ইঞ্জিন ব্যবহার করার জন্য নিবন্ধিত সমস্ত অবাণিজ্যিক প্রকল্পগুলিকে অবশ্যই আর্থ ইঞ্জিন অ্যাক্সেস বজায় রাখার জন্য
অ-বাণিজ্যিক যোগ্যতা যাচাই করতে হবে।
ee.String.replace
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
প্রতিস্থাপিত প্যাটার্নের কিছু বা সমস্ত মিল সহ একটি নতুন স্ট্রিং প্রদান করে।
ব্যবহার | রিটার্নস | String. replace (regex, replacement, flags ) | স্ট্রিং |
যুক্তি | টাইপ | বিস্তারিত | এই: input | স্ট্রিং | যে স্ট্রিংটিতে অনুসন্ধান করতে হবে৷ |
regex | স্ট্রিং | মেলে রেগুলার এক্সপ্রেশন। |
replacement | স্ট্রিং | স্ট্রিং যা মিলিত সাবস্ট্রিংকে প্রতিস্থাপন করে। |
flags | স্ট্রিং, ডিফল্ট: "" | একটি স্ট্রিং যা রেগুলার এক্সপ্রেশন ফ্ল্যাগের সংমিশ্রণ নির্দিষ্ট করে, বিশেষ করে এক বা একাধিক: 'g' (গ্লোবাল ম্যাচ) বা 'i' (কেস উপেক্ষা করুন) |
উদাহরণ
কোড এডিটর (জাভাস্ক্রিপ্ট)
print(ee.String('abc-abc').replace('abc', 'X')); // X-abc
print(ee.String('abc-abc').replace('abc', 'X', 'g')); // X-X
print(ee.String('abc-abc').replace('abc', '', 'g')); // -
print(ee.String('aBc-Abc').replace('abc', 'Z', 'i')); // Z-Abc
print(ee.String('aBc-Abc').replace('abc', 'Z', 'ig')); // Z-Z
পাইথন সেটআপ
পাইথন এপিআই এবং ইন্টারেক্টিভ ডেভেলপমেন্টের জন্য geemap
ব্যবহার করার জন্য পাইথন এনভায়রনমেন্ট পৃষ্ঠাটি দেখুন।
import ee
import geemap.core as geemap
Colab (পাইথন)
print(ee.String('abc-abc').replace('abc', 'X').getInfo()) # X-abc
print(ee.String('abc-abc').replace('abc', 'X', 'g').getInfo()) # X-X
print(ee.String('abc-abc').replace('abc', '', 'g').getInfo()) # -
print(ee.String('aBc-Abc').replace('abc', 'Z', 'i').getInfo()) # Z-Abc
print(ee.String('aBc-Abc').replace('abc', 'Z', 'ig').getInfo()) # Z-Z
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe \u003ccode\u003ereplace()\u003c/code\u003e method returns a new string with instances of a given pattern replaced by a specified replacement string.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a regular expression or a string to define the pattern to be replaced and the replacement string.\u003c/p\u003e\n"],["\u003cp\u003eOptional flags can be used to control the behavior of the replacement, such as performing a global replacement ('g') or ignoring case ('i').\u003c/p\u003e\n"],["\u003cp\u003eThe method is available for Earth Engine String objects in both JavaScript and Python environments.\u003c/p\u003e\n"]]],["The `String.replace()` method replaces substrings within a string. It takes a `regex` (pattern), `replacement` string, and optional `flags`. The input string is searched for the `regex` pattern, and matched substrings are replaced by the `replacement`. Flags, like 'g' for global or 'i' for case-insensitive matching, modify the replacement behavior. The output is the modified string, the original string is not modified. The function operates the same for Javascript and Python.\n"],null,["# ee.String.replace\n\nReturns a new string with some or all matches of a pattern replaced.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------------------------------------|---------|\n| String.replace`(regex, replacement, `*flags*`)` | String |\n\n| Argument | Type | Details |\n|---------------|---------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| this: `input` | String | The string in which to search. |\n| `regex` | String | The regular expression to match. |\n| `replacement` | String | The string that replaces the matched substring. |\n| `flags` | String, default: \"\" | A string specifying a combination of regular expression flags, specifically one or more of: 'g' (global match) or 'i' (ignore case) |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint(ee.String('abc-abc').replace('abc', 'X')); // X-abc\nprint(ee.String('abc-abc').replace('abc', 'X', 'g')); // X-X\nprint(ee.String('abc-abc').replace('abc', '', 'g')); // -\nprint(ee.String('aBc-Abc').replace('abc', 'Z', 'i')); // Z-Abc\nprint(ee.String('aBc-Abc').replace('abc', 'Z', 'ig')); // Z-Z\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nprint(ee.String('abc-abc').replace('abc', 'X').getInfo()) # X-abc\nprint(ee.String('abc-abc').replace('abc', 'X', 'g').getInfo()) # X-X\nprint(ee.String('abc-abc').replace('abc', '', 'g').getInfo()) # -\nprint(ee.String('aBc-Abc').replace('abc', 'Z', 'i').getInfo()) # Z-Abc\nprint(ee.String('aBc-Abc').replace('abc', 'Z', 'ig').getInfo()) # Z-Z\n```"]]