सूचना: जिन गैर-व्यावसायिक प्रोजेक्ट के लिए Earth Engine को 
15 अप्रैल, 2025 से पहले रजिस्टर किया गया है उन्हें ऐक्सेस बनाए रखने के लिए, 
गैर-व्यावसायिक इस्तेमाल से जुड़ी ज़रूरी शर्तों की पुष्टि करनी होगी. अगर आपने 26 सितंबर, 2025 तक पुष्टि नहीं की, तो आपके ऐक्सेस को होल्ड पर रखा जा सकता है.
  
        
 
       
     
  
  
  
    
  
  
  
    
      ee.String.index
    
    
      
    
    
      
      संग्रह की मदद से व्यवस्थित रहें
    
    
      
      अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
    
  
  
      
    
  
  
  
  
  
    
  
  
    
    
    
  
  
यह फ़ंक्शन, किसी स्ट्रिंग में सबस्ट्रिंग की पहली मौजूदगी को खोजता है.  यह फ़ंक्शन, पहले मैच का इंडेक्स या -1 दिखाता है.
| इस्तेमाल | रिटर्न | 
|---|
| String.index(pattern) | पूर्णांक | 
| आर्ग्यूमेंट | टाइप | विवरण | 
|---|
| यह: target | स्ट्रिंग | खोजे जाने वाला स्ट्रिंग. | 
| pattern | स्ट्रिंग | ढूंढने के लिए स्ट्रिंग. | 
  
  
  उदाहरण
  
    
  
  
    
    
  
  
  
  
    
    
    
      कोड एडिटर (JavaScript)
    
    
  print(ee.String('abc123').index(''));  // 0
print(ee.String('abc123').index('c1'));  // 2
print(ee.String('abc123').index('ZZ'));  // -1
// index is case-sensitive.
print(ee.String('abc123').index('BC'));  // -1
  
    
  
  
    
  
  
  
  
    
  
    
  Python सेटअप करना
  Python API और इंटरैक्टिव डेवलपमेंट के लिए geemap का इस्तेमाल करने के बारे में जानकारी पाने के लिए, 
    Python एनवायरमेंट पेज देखें.
  import ee
import geemap.core as geemap
  
    
    
      Colab (Python)
    
    
  display(ee.String('abc123').index(''))  # 0
display(ee.String('abc123').index('c1'))  # 2
display(ee.String('abc123').index('ZZ'))  # -1
# index is case-sensitive.
display(ee.String('abc123').index('BC'))  # -1
  
  
  
  
  
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
  आखिरी बार 2025-10-30 (UTC) को अपडेट किया गया.
  
  
  
    
      [null,null,["आखिरी बार 2025-10-30 (UTC) को अपडेट किया गया."],[],["The `index` function searches a string (`target`) for a specified substring (`pattern`). It returns the integer index of the first matching substring's start position. If no match is found, it returns -1. The function is case-sensitive. An empty `pattern` will always return an index of 0. The provided examples illustrate the usage and expected return values.\n"]]