Strings in Javascript | chai aur #javascript

Chai aur Code
23 Feb 202322:43

Summary

TLDRThe video script is an in-depth exploration of JavaScript strings, focusing on modern syntax and practical applications. It covers basic concepts like declaring and concatenating strings, introduces template literals for cleaner code, and delves into string methods such as trim, replace, and split. The instructor emphasizes the importance of understanding string manipulation for web development, providing examples and tips for effective learning. The script promises regular content for subscribers interested in enhancing their JavaScript skills.

Takeaways

  • 😀 The video is a tutorial focused on modern JavaScript string manipulation techniques and concepts.
  • 📝 The instructor emphasizes the importance of understanding basic concepts like 'stack', 'hit memory', 'object', and 'error' for effective coding.
  • 🎯 The video covers string interpolation, a modern syntax for embedding variables directly within strings, which is considered more reliable and modern.
  • 🔍 It discusses the use of template literals with placeholders and how they can be used to inject variables seamlessly into strings.
  • 👀 The script mentions the importance of understanding string methods and properties, such as 'length', for better string handling in JavaScript.
  • ✂️ The 'slice' method is introduced, which allows for the extraction of parts of a string, including the use of negative values for reverse indexing.
  • 🔄 The 'split' method is explained, which is used to break a string into an array of substrings based on a specified separator.
  • 🌐 The video touches on string methods like 'trim', 'replace', and 'toLowerCase', which are useful for sanitizing and manipulating strings.
  • 📚 The instructor recommends reading the MDN documentation for a comprehensive understanding of all string methods and their applications.
  • 💻 The video includes practical examples and uses the console to demonstrate the concepts being taught, providing a clear understanding of how strings work in JavaScript.
  • 🔑 The script concludes with an encouragement to practice string manipulation and to follow the channel for more content on modern coding techniques.

Q & A

  • What is the main topic of the video script?

    -The main topic of the video script is about modern JavaScript string manipulation and the various methods available for handling strings in a modern web development context.

  • What does the script mention about the syntax for declaring strings in JavaScript?

    -The script mentions that in JavaScript, you can declare strings using either single quotes or double quotes, and there is no difference between the two in terms of syntax.

  • How does the script introduce the concept of string interpolation?

    -The script introduces string interpolation as a modern syntax feature that allows developers to inject variables directly into strings using template literals, denoted by backticks and placeholders within the string.

  • What is the purpose of the 'length' property in strings as discussed in the script?

    -The 'length' property in strings, as discussed in the script, is used to determine the number of characters in a string, which is an important feature for manipulating and accessing string content.

  • How does the script explain the use of string methods like 'slice'?

    -The script explains the use of the 'slice' method in strings as a way to extract a part of a string. It also mentions the ability to use negative values with 'slice' to start the extraction from the end of the string.

  • What is the 'trim' method mentioned in the script, and what does it do?

    -The 'trim' method mentioned in the script is used to remove whitespace from both ends of a string, which is particularly useful when dealing with user input or formatting in web development.

  • How does the script describe the process of string concatenation?

    -The script describes string concatenation as a process where multiple strings or variables can be combined into a single string using the plus (+) symbol in JavaScript.

  • What is string interpolation as discussed in the video script?

    -String interpolation, as discussed in the video script, refers to embedding variables and expressions within a string literal, allowing for dynamic content insertion directly into the string.

  • What are some of the string methods mentioned in the script that can be used to manipulate strings?

    -Some of the string methods mentioned in the script include 'slice', 'trim', 'replace', 'split', and methods for accessing string properties like 'length'.

  • How does the script suggest using the 'replace' method in strings?

    -The script suggests using the 'replace' method to search for specific patterns or substrings within a string and replace them with different text, which is useful for various string manipulation tasks.

  • What is the 'split' method used for in strings, as mentioned in the script?

    -The 'split' method, as mentioned in the script, is used to divide a string into an array of substrings based on a specified separator, which can be a character or a string.

Outlines

00:00

😀 Introduction to Modern JavaScript String Concepts

The speaker welcomes the audience to a session on tea and court, apologizes for being late, and promises regular content. They introduce the topic of modern JavaScript string manipulation, emphasizing the importance of understanding data types like stack memory and hit memory. The speaker encourages the audience to be familiar with terms like 'object' and 'error'. They begin with basic string operations in JavaScript, such as declaring strings with single or double quotes and concatenating strings using the plus symbol. The speaker also mentions the use of variables to store strings and the importance of understanding modern coding practices.

05:02

😇 Exploring JavaScript String Objects and Methods

The speaker delves into the concept of strings as objects in JavaScript, highlighting the ability to access properties and methods associated with them. They discuss how strings can be declared using the 'new String' syntax and how this creates a string object with various methods and properties. The speaker demonstrates accessing string properties like 'length' and methods such as 'charAt', 'includes', and 'indexOf'. They also touch on the topic of string immutability, showing that methods that appear to modify strings actually return new string instances.

10:03

😉 Advanced String Manipulation Techniques

The speaker introduces advanced string manipulation techniques, such as using the 'slice' method to extract parts of a string and the 'replace' method to substitute characters or patterns within a string. They explain the syntax and functionality of these methods, providing examples to illustrate their use. The speaker also discusses the importance of understanding how to break strings into parts and sanitize them, hinting at the usefulness of these skills in web development and programming.

15:04

🎓 Utilizing String Methods for Cleaning and Formatting

The speaker focuses on the practical applications of string methods for cleaning and formatting data, such as removing unnecessary spaces and replacing unwanted characters. They demonstrate the 'trim' method to remove whitespace from the beginning and end of a string and the 'replace' method to substitute specific characters or patterns. The speaker also mentions the importance of understanding browser compatibility and the use of regular expressions for more complex string manipulation tasks.

20:04

🛠 Practical Examples of String Manipulation

The speaker provides practical examples of string manipulation, such as splitting strings into arrays using the 'split' method and converting strings to different cases using methods like 'toLowerCase' and 'toUpperCase'. They discuss the importance of these techniques in tasks like URL manipulation and data cleaning. The speaker also encourages the audience to explore the extensive documentation available for JavaScript strings to discover new methods and improve their coding skills.

📚 Conclusion and Encouragement for Further Learning

In the concluding part, the speaker summarizes the importance of understanding and practicing string manipulation in JavaScript. They encourage the audience to continue learning about strings, to explore the documentation, and to practice these concepts to improve their coding abilities. The speaker also invites the audience to subscribe and share the video, expressing their enjoyment in creating the content and looking forward to the next session.

Mindmap

Keywords

💡String

A 'String' in programming, including the context of this video, refers to a sequence of characters used to represent text. It is a fundamental data type in many programming languages. In the script, the concept of strings is explored in-depth, showing how they are declared and manipulated in JavaScript, which is central to the video's theme of modern coding practices.

💡Interpolation

Interpolation is a method of embedding variables or expressions within a string to create a dynamic text. This concept is highlighted in the script as a modern syntax for writing strings in JavaScript, allowing for more readable and maintainable code. An example from the script is using template literals with placeholders to inject values directly into strings.

💡Prototype

The 'Prototype' concept in JavaScript refers to the mechanism by which objects inherit properties and methods from other objects. In the video, the script discusses how strings, as objects, have access to methods defined on their prototype, showcasing the powerful and flexible nature of JavaScript's prototype-based inheritance.

💡Methods

'Methods' are functions defined on objects that perform operations on the object's data. The script mentions various string methods, such as 'slice', 'trim', and 'replace', which are used to manipulate and extract information from strings, demonstrating the versatility of strings in JavaScript.

💡Trim

The 'Trim' method is used to remove whitespace from both ends of a string. In the context of the video, it is presented as a useful tool for sanitizing user input or formatting strings before processing or storage, which is crucial for maintaining data integrity.

💡Replace

The 'Replace' method in strings is used to find and replace specified characters or patterns within a string. The script discusses this method in the context of cleaning up URLs or text content by replacing unwanted characters or patterns, which is essential for preparing data for web applications.

💡Slice

'Slice' is a method used to extract a portion of a string. The script explains how to use the slice method with negative values to start from the end of the string, showcasing a practical application of this method in string manipulation for various programming tasks.

💡Concatenation

Concatenation refers to the operation of joining two or more strings together. In the video script, it is shown how to concatenate strings using the '+' operator, which is a basic yet essential concept in creating dynamic text outputs in JavaScript.

💡Template Literals

Template literals, introduced with backticks in the script, allow for more readable and concise syntax for creating strings with embedded expressions. The video emphasizes this modern feature of JavaScript, which simplifies the process of inserting variables and expressions into strings.

💡Data Types

In the context of the video, 'Data Types' refer to the various kinds of values that variables can hold, such as numbers, booleans, and objects. The script discusses how different data types can be concatenated or manipulated within strings, which is fundamental to understanding how to work with diverse data in JavaScript.

💡Modern Syntax

The term 'Modern Syntax' in the script refers to the current best practices and language features used in JavaScript for writing clean and efficient code. The video aims to educate viewers on how to utilize these modern syntax features when working with strings and other data types.

Highlights

Introduction to modern JavaScript string concepts and their importance in coding.

Explanation of basic string syntax and operations like concatenation using the plus symbol.

Discussion on declaring strings with single or double quotes and their equivalence in JavaScript.

Introduction to string interpolation as a modern way to inject variables into strings.

Demonstration of string interpolation with variables using template literals.

Explanation of the backtick (``) syntax for creating strings in modern JavaScript.

Highlighting the use of string methods like `length` and their availability on the prototype.

Introduction to string object properties and methods, emphasizing their usefulness in modern development.

Explanation of how strings are treated as objects in JavaScript with properties like `length`.

Discussion on accessing string methods directly without the need for constructor syntax.

Introduction to string methods like `toLowerCase`, `toUpperCase`, and their practical applications.

Explanation of how to use string methods to manipulate case and whitespace in strings.

Demonstration of using the `trim` method to remove unnecessary whitespace from strings.

Introduction to the `replace` method for string manipulation and its use cases.

Explanation of how to use the `slice` method for substring extraction with both positive and negative indices.

Discussion on the `split` method for breaking strings into arrays based on a delimiter.

Highlighting the importance of understanding string methods for effective front-end and back-end development.

Recommendation to practice string manipulation and explore the extensive documentation for deeper understanding.

Emphasis on the modern syntax and methods for strings, advising against outdated practices.

Encouragement to follow and engage with the content for continuous learning and updates on JavaScript strings.

Transcripts

play00:00

हान जी स्वागत है आप सभी का चाय और कोर्ट

play00:02

में काफी लेट हो गया आज लेकिन वीडियो तो

play00:05

बिल्कुल बनाएंगे और आपके लिए कंटेंट भी

play00:07

रेगुलर लाएंगे क्योंकि आपने ऑलरेडी

play00:08

सब्सक्राइब कर दिया है तो इस वीडियो में

play00:10

हम और आगे थोड़ा सा प्रोसीड करते हैं बहुत

play00:13

ही जल्द हम कंडीशनर और वो सभी देखेंगे बट

play00:15

थोड़ा सा मैं आपको और डाटा टाइप्स के बारे

play00:17

में स्ट्रांग करना चाहता हूं ताकि जिससे

play00:18

हम जैसे ही हम इफ लक या फिर लूप्स यह सब

play00:21

स्टार्ट करें तो हम बहुत ही स्पीड ली मूव

play00:23

कर पाए क्योंकि आपके बेसिक क्लियर है आपको

play00:25

पता है स्टैक क्या है हिट मेमोरी क्या है

play00:27

कौन सा वाला ऑब्जेक्ट है कौन सा वाला एरर

play00:29

है ये सब आपके पास डिटेल में रहे तो इस

play00:31

वीडियो में हम बात करेंगे स्ट्रिंग्स के

play00:33

बारे में स्ट्रिंग बहुत ही इंटरेस्टिंग

play00:34

कॉन्सेप्ट है किस तरह से आप अपने कोड को

play00:37

मॉडर्नाइज लिख सकते हैं क्योंकि स्ट्रिंग

play00:38

आपने काफी बार पहले भी पढ़ा होगा

play00:40

जावास्क्रिप्ट में कोई इतना कोई खास नहीं

play00:42

है लेकिन जिस तरह से अगर आप आज की डेट में

play00:44

कोड लिख रहे हैं तो आपको स्ट्रिंग का जो

play00:46

मॉडर्न सेंटेंस है वही उसे करना चाहिए तो

play00:48

इस वीडियो में उसी के बारे में बात करूंगा

play00:49

मैं आपसे तो चलिए शुरू करते हैं हमारी कोड

play00:52

फाइल के अंदर एक नई फाइल मैंने ऐड कर दिया

play00:54

जीरो फाइव स्ट्रिंग क्योंकि हम स्ट्रिंग

play00:55

के अंदर इसके अंदर बात करेंगे आपको मैं

play00:57

कंसोल के अंदर भी स्ट्रिंग दिखाऊंगा ताकि

play00:59

आपको एक्चुअली में डिटेल पता लगे स्ट्रिंग

play01:02

का है क्या चीज तो सबसे पहले हम कंसोल के

play01:04

अंदर ही चलते हैं और बेसिक आपको दिखाता

play01:06

हूं तो इंस्पेक्टर पे क्लिक करिए और कंसोल

play01:09

में जाइए तो ये हमारा कंसोल है तो आप

play01:11

देखेंगे की स्ट्रिंग सिंगल को से भी डिनोट

play01:13

करते हैं और डबल को से भी करते हैं जावा

play01:15

स्क्रिप्ट के अंदर इसके अंदर कोई ऐसा

play01:16

डिफरेंस नहीं है आप चाहे तो सिंगल से करिए

play01:19

डबल से करिए कुछ भी नहीं है अब सबसे पहला

play01:21

जो आप स्ट्रिंग का देखेंगे वो देखेंगे की

play01:23

डबल कोट्स में स्ट्रिंग आपने डिक्लेयर कर

play01:25

दी है और दो स्ट्रिंग्स को ऐड करने के लिए

play01:27

इस तरह से प्लस सिंबल उसे होता है और आपने

play01:29

यहां पे लिख दिया हेलो वर्ल्ड ठीक है लिख

play01:32

देते हैं कोई इशू नहीं है और दोनों

play01:34

स्ट्रिंग एक साथ अटैच हो गई है कॉन्टैक्ट

play01:36

हो गई है ये सिंटेक्स है ठीक है कोई

play01:39

प्रॉब्लम नहीं है बट इतना बेसिक हो गया

play01:40

अभी हम एक बार मूव करते हैं यहां पे की ये

play01:43

तो हो गया हमारा बेसिक स्ट्रिंग लेकिन जब

play01:44

आप प्रोग्राम में लिखेंगे स्ट्रिंग्स को

play01:46

तब आप वैरियेबल्स में इसको लेंगे जैसे फॉर

play01:48

एग्जांपल आपने कहा नाम तो नाम हो गया मेरा

play01:50

यहां पे नाम लिख दिया मैंने ठीक है अब

play01:53

आपके पास और भी डाटा टाइप्स आएंगे अरे भी

play01:56

आएंगे नंबर्स भी आएंगे boliyans भी आएगी

play01:58

इस तरह के और भी वैल्यू आएगी जैसे फॉर

play02:00

एग्जांपल यहां पे मैं लिख देता हूं की

play02:02

मैंने कुछ

play02:03

रैप अकाउंट की मेरे गेट हफ्ते कितने

play02:06

रिपोजिटरी है जैसे रिज्यूम रिज्यूम करते

play02:08

हैं की हम 50 रिपोजिटरीज है आई थिंक

play02:10

ज्यादा ही होगी इससे बट ठीक है अब इन

play02:12

दोनों को मुझे अगर कंकेट करना है तो अभी

play02:15

हमने देखा की कंसों लॉक के अंदर हम कर

play02:17

सकते हैं जिस तरह से अभी हमने किया है तो

play02:19

सिंपली आप क्या करेंगे यहां पे नेम और

play02:21

इसको कंकेट कर देंगे सिंपली

play02:24

रैप अकाउंट के साथ

play02:27

रेप काउंट और इसके साथ-साथ आप कुछ और भी

play02:31

कंकेट कर सकते हैं ये जो स्क्रैच हुआ है

play02:33

नेम इस पर ध्यान मत दीजिए कई बार ये

play02:35

लेंटिंग फीचर्स है टाइप स्क्रिप्ट वगैरह

play02:37

का वो सब दे देता है लेकिन इसके साथ आप और

play02:39

भी ऐड कर सकते हैं जैसे की वैल्यू और

play02:42

समथिंग जो भी आपको ऐड करना है इसको एक बार

play02:44

मैं रन करके आपको दिखाता हूं बहुत इजी है

play02:51

तो यहां पर

play02:53

लिखना था वो ए गया है अब ये जो सिंटेक्स

play02:56

आप सबसे ज्यादा देखेंगे की आपको कुछ भी

play02:58

नहीं करना है कोई भी वेरिएबल करना है तो

play03:00

प्लस प्लस लिख के कर दीजिए कॉमन लगा के कर

play03:02

दीजिए ये सिंटेक्स मुझे बिल्कुल भी कहीं

play03:05

से भी अच्छा नहीं लगता है इसके थ्रू मैं

play03:07

आज की डेट में किसी को भी रिकमेंड नहीं

play03:09

करता हूं की आप इस सिंटेक्स को उसे करें

play03:10

क्योंकि ये थोड़ा सा अपडेट है मॉडर्न डेज़

play03:12

में इस तरह से कोई भी लिखना पसंद नहीं

play03:14

करता है अगर आज की डेट में आपको लिखना है

play03:16

तो आप उसे करेंगे बैक टेक्स्ट बैक टेक्स्ट

play03:19

उसे करने का फायदा क्या है यहां पे आता है

play03:20

स्ट्रिंग इंटरपोलेशन नाम काफी परिसर है बट

play03:24

है क्या की आप बनाते हैं प्लेस होल्डर्स

play03:25

उनके अंदर जो भी वारी है आप डायरेक्टली

play03:28

वहां पर इंजेक्ट कर सकते हैं जैसे

play03:30

सपोर्ट करिए हेलो

play03:32

माय नाम इसे और उसके बाद आपको यहां पर

play03:35

वेरिएबल इंजेक्ट करना है तो आप डॉलर साइन

play03:36

उसे करिए यहां पर लिखकर और लिखते जाइए

play03:48

ज्यादा रिलायबल है तो यहां पे आके मैं

play03:51

सिंपली नाम फुल कर दिया यहां पे आके मैंने

play03:53

रैप अकाउंट फिल कर दिया तो यह जो सिंटेक्स

play03:56

कंपेरटिवली मुझे बटर लगता है रेड लगता है

play03:59

और आप भी जब बैक हैंड डेवलपमेंट वगैरा

play04:00

करेंगे तो ज्यादातर इसी को उसे करेंगे

play04:02

रिजल्ट में कोई डिफरेंस नहीं है बट ये

play04:04

थोड़ा सा मॉडर्न वेयर सिंटेक्स का जिसको

play04:06

स्ट्रिंग इंटरपोलेशन बोला जाता है अब इसका

play04:08

फायदा क्या है की आप बहुत सारी चीज ऑन डी

play04:10

गोभी कर सकते हैं जैसे स्ट्रिंग है नाम है

play04:12

तो मेरे को कुछ मैथर्ड के अंदर करना है

play04:14

जैसे आर तू अपार केस है जो भी मुझे लगाना

play04:16

है तो मैं यहां पे इजीली इसको उसे कर सकता

play04:18

हूं तो वो भी आप कर सकते हैं अच्छा ये तो

play04:20

हो गया बेसिक

play04:23

कॉन्सेप्ट है इंटरेस्टिंग कैसे बताता हूं

play04:25

आपको की जैसे सपोस करिए मैंने यहां पर कहा

play04:28

की मुझे एक स्ट्रिंग बताइए तो मैंने कहा

play04:30

की

play04:32

डॉट लोग और मैंने यहां पर स्ट्रिंग को

play04:36

प्रिंट कर

play04:38

हेलो

play04:40

तो आपके पास यहां पर हेलो प्रिंट हो गया

play04:49

स्ट्रिंग को डिक्लेयर करना है एक और तरीका

play04:52

भी है जैसे की सपोर्ट करिए मैं यहां पर

play04:54

देता हूं गेम नाम सपोज करिए मैं कोई गेम

play04:57

नाम या डिस्कार्ड नाम चीज कर रहा हूं तो

play04:59

आप एक और सिंटेक्स उसे कर सकते हैं जिसके

play05:01

अंदर न्यू कीवर्ड उसे करते हैं तो आप

play05:03

ऑब्जेक्ट उसे करते हैं जप के और यहां पे

play05:05

अपने स्ट्रिंग का उसे कर और उसके

play05:07

कंस्ट्रक्टर के अंदर आपने नाम दिया जैसे

play05:09

मैंने दिया हितेश क तो ये नाम हो गया

play05:12

हमारे पास वैल्यू से ही आएगी जैसे

play05:14

स्ट्रिंग डिक्लेयर करते हैं कोई खास

play05:15

डिफरेंस नहीं है बिहाइंड डी सीन ये भी

play05:17

आपका ऑब्जेक्टिव इन्वोक कर रहा है तो इसी

play05:18

तरह से हो जाता है लेकिन इंटरेस्टिंग चीज

play05:21

यहां पे ये है की मैं इस वेरिएबल को कॉपी

play05:22

करता हूं और यहां पे आपको कुछ इंटरेस्टिंग

play05:25

चीज दिखाता हूं इसको जैसे मैंने रन कर अब

play05:28

मैंने इसको बोला की गेम नाम बताओ मुझे

play05:29

सॉरी

play05:32

[संगीत]

play05:35

आपके पास आया है वैल्यू और जैसे मैंने

play05:38

इसको ओपन कर तो आप देख सकते हैं जीरो

play05:40

पोजीशन ह है अभी जो पोजीशन है इससे यह मत

play05:43

कंफ्यूज करेगा की अरे स्ट्रिंग एक

play05:45

ऑब्जेक्ट है यहां पे आप टाइप भी देखेंगे

play05:47

स्ट्रिंग का तो वो भी देख सकते हैं ये की

play05:50

वैल्यू पैर से जीरो इसकी की है वैल्यूज की

play05:52

है तो ऑटोमेटेकली ये आपके पास ए जाता है

play05:55

अब इसमें सबसे इंटरेस्टिंग क्या है की

play05:57

आपके पास एक लेंथ प्रॉपर्टी आपको मिलती है

play05:58

प्लस आपके पास बहुत सारे और मैथर्ड भी

play06:01

मिलते हैं जो की प्रोटोटाइप के अंदर है हम

play06:03

आगे जाके वीडियोस में प्रोडक्ट आई

play06:04

प्रोटोटाइप इन्हेरिटेंस ये भी सब देखेंगे

play06:06

और अभी मैं जैसे इसको ओपन करता हूं तो आप

play06:08

देख सकते हैं कितने सारे मैथर्ड अवेलेबल

play06:10

हैं सारे मेथड तो ऑब्वियस सी बात है हम

play06:12

डिस्कस नहीं कर सकते एक वीडियो में बट देख

play06:14

सकते हैं आप यहां पर एंड्स की कंस्ट्रक्टर

play06:16

भी है कंकेट भी है कैरक्टर आते भी है

play06:19

पद एंड कितने सारे पैसे हैं जो मैंने कभी

play06:22

उसे भी नहीं करें बट आपके पास बहुत मेथड

play06:24

मिलते हैं इन मेथड को मास्टर करना ही

play06:26

एक्चुअली में स्ट्रिंग के बारे में पढ़ाई

play06:28

करने का सारा का सारा हमारा फोकस रहेगा

play06:30

कुछ मैथर्ड में आपको बता देता हूं की कैसे

play06:33

इजीली रहेंगे लेकिन यहां पर देखिए एक आधा

play06:36

चीज मैं आपको और इंटरेस्टिंग है यहां पे

play06:37

दिखाता हूं कौन सा लॉक करके तो सबसे पहले

play06:39

की आपको कोई प्रॉपर्टी से पता है तो इजीली

play06:43

आपको जैसे देखना है तो मैं सपोर्ट करिए

play06:45

गेम नेम लिया उसकी किस एक्सेस करनी है तो

play06:48

मैं जीरो थी उसकी एक्सेस करता हूं तो

play06:50

ऑब्वियस सी बात है कोई सरप्राइज नहीं होना

play06:52

चाहिए आप लोगों को की वैल्यू चाहिए तो की

play06:54

वैल्यू पर हमें एक्सेस करना ए गया है इसके

play06:56

अलावा सिर्फ इतना ही नहीं जो हमने यहां पे

play06:57

ये प्रोटोटाइप देखा था ये भी एक्सेस किया

play06:59

जा सकता है तो आप क्या कर सकते हैं डॉट और

play07:03

यहां पे बहुत सारे सिंटेक्स इसको एक्सेस

play07:04

करने के एक से सिंटेक्स में मैं आपको

play07:06

बताता हूं अंडरस्कोर अंडरस्कोर प्रोटो ये

play07:10

दिख रहा है एक अंडरस्कोर है वीडियोस में

play07:12

बट ये दो अंडरस्कोर हैं और अंडरस्कोर

play07:14

अंडरस्कोर और भी तरीके हैं बट ये मेथड

play07:16

सबसे इजी है आपके लिए तो आप देखेंगे तो आप

play07:18

देखेंगे की हां ये ऑब्जेक्ट मिल गया ये

play07:20

ऑब्जेक्ट अभी आपको एम्टी मिला है लेकिन

play07:22

एक्चुअली में ये एम्टी नहीं है इसके अंदर

play07:24

और भी बहुत सारी वैल्यूज है सबसे इजी

play07:26

तरीका है वैल्यूज को देखने का यहां पे आप

play07:28

कौन सा लॉक के अंदर एक्सेस आप सबको कर

play07:30

सकते हैं अभी जितने भी मैथर्ड हैं उनको

play07:32

एक्सेस करने के लिए आपको ऐसा नहीं करना

play07:33

पड़ेगा

play07:37

नहीं आप डायरेक्ट ही एक्सेस कर सकते हैं

play07:39

ये सिंटेक्स है तो उसमें सिंटेक्स मैं

play07:41

आपको प्रोटॉन नहीं लगाना पड़ता बट आप

play07:43

देखना चाहें तो ऑब्जेक्ट देख सकते हैं ऐसी

play07:44

कोई बात नहीं है तो कुछ मैं आपको ऑब्जेक्ट

play07:46

इसके उसे करके दिखा देता हूं की किस तरह

play07:48

से किए जाते हैं तो कौन सा लॉक करते हैं

play07:51

हम यहां पे तो सबसे पहले हम चाहते हैं गेम

play07:53

नेम पे अब हमने अभी देखा है यहां पे

play07:56

नेम की सबसे पहली जो हमने चीज देखी वो एक

play08:00

प्रॉपर्टी देखी डॉट लेंथ अभी जितने भी

play08:03

मैथर्ड हैं इसका एक इंटरेस्टिंग चीज बताता

play08:05

हूं आपको कहीं पे भी यह नहीं लिखना पड़ेगा

play08:06

जैसे आप डॉट लेंथ एक्सेस करते हैं वैसे ही

play08:08

आप सारे प्रोटो टाइप के मेथड भी एक्सेस कर

play08:10

सकते हैं और एग्जांपल यहां पे जाता हूं और

play08:13

मैं इसको बोलता हूं डॉट लेंथ

play08:16

वेरी गुड और इसको मैं प्रिंट करता हूं

play08:19

यहां पर तो 8 यहां पर लेंथ ए गई लेकिन और

play08:22

भी जो मेथड है वह इसी तरह से डायरेक्ट

play08:24

एक्सेस कर सकते हैं जैसे की फॉर एग्जांपल

play08:26

प्रोटोकॉल के अंदर में गया और यहां पर आप

play08:28

थोड़ा सा स्क्रॉल करेंगे तो आपको तू

play08:30

सेक्शन में कुछ मैथर्ड दिखेंगे तो लोअर

play08:32

केस तू अपार केस ये सारे और उनके आगे एफ

play08:34

लिखा हुआ है मतलब ये सारे फंक्शंस हैं

play08:36

सारे के सारे एफ है यहां पे देख सकते हैं

play08:38

आप तो ये सारे के सारे फंक्शंस या फिर

play08:41

मेथड से जो आपके लिए डायरेक्टली अवेलेबल

play08:43

है तो एक हम इसमें से उसे करके देखते हैं

play08:45

डॉट तू अपार केस तो आप नोटिस करेंगे मैंने

play08:48

ये नहीं लिखा है यहां पे की डॉट अंडरस्कोर

play08:51

अंडरस्कोर प्रोटो अंडरस्कोर अंडरस्कोर और

play08:53

उसके बाद मैं लिख रहा हूं तू अपार केस में

play08:55

डायरेक्टली aparkesh उसे कर सकता हूं ये

play08:58

फीचर हम कैसे आता है क्या आता है यह जाओ

play08:59

स्क्रिप्ट का पूरा सिंटेक्स हम प्रोटॉन

play09:01

टाइप ए रहे हैं वाली वीडियो में समझेंगे

play09:02

बट अभी के लिए हम एक मेथड यहां पे रन करके

play09:04

देखते हैं तो हमें जो वैल्यू मिली वो सारा

play09:06

का सारा कन्वर्ट हो गया लेकिन इसने हमारी

play09:08

ओरिजिनल स्ट्रिंग को चेंज नहीं किया है

play09:10

क्यों ये हमने पिछले वीडियो में देख चुके

play09:13

हैं ऑलरेडी की आप जब भी ऐसा करते हैं तो

play09:15

स्टार्क और जो हिप वीडियो है जो कमेंट में

play09:18

बताइएगा किस-किस ने देख लिया है तो उनको

play09:19

ये समझ में आएगा की हान और इसने वैल्यू

play09:21

चेंज नहीं हुई है क्यों ये आप इंटरव्यू

play09:23

में हमेशा आंसर कर सकते हैं तो इसीलिए

play09:25

पहले मैं इसको स्ट्रांग कर रहा हूं कुछ और

play09:27

इंटरेस्टिंग मेथड के बारे में मैं आपको

play09:28

बता देता हूं जैसे की सपोर्ट करिए की आपको

play09:32

कोई कैरेक्टर देखना है की ये कैरक्टर किस

play09:34

पोजीशन पे है या क्या है तो स्ट्रिंग के

play09:36

अंदर एक मेथड होता है ये क्या है आते तो

play09:39

कौन सा कैरक्टर किस पोजीशन पे जैसे सपोस

play09:41

करिए इसके अंदर मुझे देखना है टिक इस

play09:43

पोजीशन पे है तो आप डायरेक्टली यहां पे एक

play09:46

चीज इंपॉर्टेंट ध्यान रखिएगा ऐसे टीम नहीं

play09:48

लिख सकते इसको अगर आप रन करेंगे तो आप

play09:50

देखेंगे की ये बोल रहा है की अरे ऐसा

play09:53

थोड़ी ना होता है की आप डिफाइन कर दोगे

play09:54

ऐसे आपको एक स्ट्रिंग मैच कर देंगे या फिर

play09:57

एक कैरक्टर मैच करना है तो कैरक्टर तो दो

play09:59

तो इस तरह से हमने कैरक्टर लिया इसको रन

play10:02

कर और मुझे मिल गया यहां पे की आपके पास

play10:04

ये

play10:05

[संगीत]

play10:06

ओह माय बेड थोड़ा सा भावनाओं में ज्यादा

play10:10

हो गए तो कैरक्टर देखना है की किस पोजीशन

play10:13

पे कैरक्टर है तो मैंने यहां पे थोड़ा सा

play10:15

इंडेक्स लिख दिया इस तरह से नहीं कैरक्टर

play10:17

आते तो किस इंडेक्स पर कौन सा कैरक्टर है

play10:19

वो हम देख सकते हैं तो जैसे मुझे देखना है

play10:21

की सेकंड पोजीशन पे कौन सा कैरक्टर है तो

play10:23

यहां पे आप नंबर्स पास करते हैं ना की

play10:25

कैरेक्टर माय बेड होता है प्रोग्रामिंग

play10:27

में होता है कई बार तो अब देखते हैं सेकंड

play10:29

पोजीशन पे कौन सा है तो जीरो वैन और तू तो

play10:32

यहां पे टी कैरक्टर है से करते हैं इसको

play10:34

रन करते हैं बाकी मैंने सब कमेंट कर दिया

play10:36

क्योंकि थोड़ा सा कंफ्यूज कर रहे द तो

play10:38

यहां पर हमने देखा की इस पोजीशन पे है

play10:39

आपका टी एल एम एन तो ये तो हो गया

play10:41

कैरेक्टर अच्छा अब जब बात चली रही है की

play10:43

आपको पता करना है की कौन सा पोजीशन पे कौन

play10:47

सा कैरक्टर तो इसका रिवर्स करना हो तो

play10:48

क्या करें जैसे सपोस करिए मुझे पता करना

play10:50

है की टी किस पोजीशन पे है वो पता करने के

play10:53

लिए भी उसके लिए भी आपके पास मेथड है

play10:55

सिंपल इंडेक्स ऑफ तो इंडेक्स ऑफ के अंदर

play10:58

आप पता लगा सकते हैं की ये कैरक्टर किस

play11:01

पोजीशन पे आपके पास ए रहा है और यहां पे

play11:03

आप टी लिख सकते हैं तो जैसे मैं इसको से

play11:05

करता हूं और वैसे रन करके देखते हैं तो

play11:07

मुझे पता लग गया की सेकंड पोजीशन पे टी है

play11:09

वेरीफाई भी हो गया ठीक है ओके बड़ा ही इसे

play11:12

था लेकिन अब यहां पे कुछ इंटरेस्टिंग

play11:14

मैथर्ड आपको बताता हूं मैं कई बार क्या

play11:16

होता है स्ट्रिंग को आपको कुछ पार्ट्स में

play11:18

ब्रेक करना होता है या उसको सैनिटाइज करना

play11:20

होता है उसे तरह के मैथर्ड तो स्ट्रिंग के

play11:22

मैथर्ड के बारे में आप जितना ज्यादा

play11:23

जानेंगे उतना ही आपके लिए फायदा होगा अब

play11:26

हमेशा ऐसा नहीं की आपको जाना है एमडीएम के

play11:27

डॉक्स में देखना है कुछ सबसे जो आसान

play11:29

तरीका है किसी भी मेथड के बारे में देखना

play11:31

जानना वो सिंपली आप यहां पे आके देख सकते

play11:34

हैं जैसे सपोस करिए हमने देखना लोअर केस

play11:35

आप इसको ओपन करेंगे नाम से ही पता लग रहा

play11:38

है की लोअर केस है बस ठीक है इससे कम हो

play11:40

जाता है और किसी का भी अगर आपको लगे की

play11:42

जैसे मुझे सब स्ट्रिंग का नहीं पता ये

play11:43

कैसे कम करता है तो सीधा जाइए एमडी एंड

play11:45

डॉग्स पे तो मैं सभी को raycommend करूंगा

play11:47

की एक बार थोड़ा सा 15 मिनट 1/2 घंटा

play11:50

बताइए या फिर एक आर्टिकल लिखिए की

play11:52

स्ट्रिंग्स के मेथड कितने हैं एक बार अगर

play11:54

आप सारे मैथर्ड के थ्रू गो थ्रू कर लेंगे

play11:56

तो इंटरव्यू से लेकर सभी को आपके पास

play11:57

क्रैक हो जाएगा अच्छा कुछ और मैथर्ड आपको

play11:59

बताऊंगा ऐसा नहीं की सिर्फ यही पे आपको

play12:01

मैं छोड़ दूंगा कुछ और मैथर्ड आपको बताता

play12:04

हूं जैसे देखिए हमारे पास ये मेथड है अभी

play12:06

हमने लिखा यहां पर हितेश हक तो मैं क्या

play12:10

करता हूं यहां पर लिख देता हूं हितेश दश क

play12:13

ताकि और भी कुछ अब प्रैक्टिस कर पाए तो

play12:16

कुछ और मैथर्ड मैं आपको बताता हूं आप सबसे

play12:18

इंपॉर्टेंट जो मेथड है पहले हमने वेरिएबल

play12:20

का नाम रखा गेम नाम तो ठीक है गेम नाम अब

play12:23

इसके अंदर मुझे क्या करना है इस सिंपली

play12:25

मुझे करना है स्लाइस तो आप इसको किसी

play12:28

वेरिएबल में भी स्टोर कर सकते हैं तो मैं

play12:30

इसको एक वेरिएबल में स्टोर कर लेता हूं

play12:32

न्यू स्ट्रिंग नाम से और मैंने बोला ये जो

play12:35

गेम नाम है मुझे इसको करना है एक सब

play12:38

स्ट्रिंग में डिवाइड तो बोला की ये ठीक है

play12:40

सब स्ट्रिंग में आप कर लीजिए अब क्या-क्या

play12:42

इसके अंदर अरगुमेंट देने पड़ेंगे मुझे

play12:44

देना पड़ेगा स्टार्ट नंबर और देना पड़ेगा

play12:46

एक एंड नंबर ठीक है तो स्टार्ट नंबर मैं

play12:48

इसको देता हूं सपोर्ट करिए जीरो और एन

play12:52

नंबर देता हूं

play12:53

इंटरेस्टिंग चीज क्या है जब हम इसको कंसोल

play12:55

लॉक करेंगे तो आपको ये पता होना चाहिए की

play12:58

एक्चुअली में आंसर आएगा क्या कैसे मैं

play13:00

आपको बताता हूं ये भी डिटेल में

play13:02

तो यहां पर ह आई टी आई नोटिस करिए

play13:07

मेरे पास जीरो से मैंने स्टार्ट कर तो यह

play13:10

जो है जीरो वैन तू

play13:15

नोटिस करिए तीन कैरक्टर है तो मतलब लास्ट

play13:18

में जो आपने वैल्यू डाली है वो इंक्लूड

play13:21

नहीं हो रही है यह सबसे इंपॉर्टेंट चीज है

play13:23

जो आपको ध्यान रखनी है अच्छा ये तो हो गया

play13:25

आपका बेसिक्स सब स्ट्रिंग में हमने उसको

play13:27

डिवाइड कर लिया लेकिन और भी मैथर्ड आते

play13:29

हैं और अगर ये सब कुछ बेसिक सी है तो यहां

play13:33

पर हमने देखा अब आपके पास ये जो सब

play13:35

स्ट्रिंग ए गया है इसके साथ एक और

play13:37

इंपॉर्टेंट इंटरेस्टिंग चीज है बताता है

play13:39

आपको अभी तो यहां पे भी हम क्या करते हैं

play13:42

एक नया वेरिएबल ले लेते हैं अंदर स्ट्रिंग

play13:45

और इसके अंदर क्या करते हैं इस बार एक और

play13:47

नया मेथड उसे करते हैं उसे मेथड के अंदर

play13:49

थोड़ी सी और इंटरेस्टिंग चीज हैं जिसका

play13:51

नाम है डॉट स्लाइस तो डॉट स्लाइस के अंदर

play13:54

आप क्या कर सकते हैं

play13:59

क्या लगता है स्लाइस का आप इसमें नेगेटिव

play14:02

वाल भी दे सकते हो अगर आप नेगेटिव वैल्यूज

play14:04

देंगे तो रिवर्स से स्टार्ट होगा जैसे

play14:06

हमें पता है की इसका लेंथ अभी आते है तो

play14:09

सपोस करिए मैं इसका स्टार्ट देता हूं

play14:11

-8 तो अभी क्या वैल्यू आएगा तो ये सबसे

play14:15

इंटरेस्टिंग रहता है तो आपके पास वापस से

play14:16

क्योंकि आपने अन इसको प्रिंटिंग नहीं कर

play14:19

अभी तो हमने

play14:20

तो एक बार इसको रन करते हैं और प्रिंट

play14:23

करते हैं क्योंकि रिजल्ट्स के बड़े

play14:24

इंटरेस्टिंग आते हैं जब आप रिवर्स वैल्यूज

play14:27

देते हैं तो देखिए आईटीआई तो इसमें पीछे

play14:30

से स्टार्ट कर और फिर फोर कैरेक्टर

play14:31

क्योंकि ओबवियस सी बात है -8 है तो

play14:33

नेगेटिव से जाके स्टार्ट करेगा तो ये बड़े

play14:35

स्लाइस के अंदर इंटरेस्टिंग कॉन्सेप्ट आते

play14:37

हैं स्लाइस आप काफी बार उसे करेंगे और

play14:39

स्लाइस के अंदर ही आप नेगेटिव वैल्यूज उसे

play14:41

कर सकते हैं क्या सबस्ट्रिंग में भी

play14:42

नेगेटिव वैल्यू उसे कर सकते हैं बिल्कुल

play14:44

अभी आपको बताते हैं इसके अंदर अगर वैल्यूज

play14:46

उसे करेंगे इस तरह की नेगेटिव तो ये आपको

play14:48

देगा की ठीक है मैं तो नहीं वो बेकरार की

play14:52

आपने नेगेटिव वैल्यूज दी है मैं आपकी

play14:53

वैल्यू को इग्नोर कर दूंगा और जीरो से

play14:55

स्टार्ट कर दूंगा तो यहां पे हम नहीं दे

play14:58

सकते हैं ठीक है बड़ा इंटरेस्टिंग

play15:00

कॉन्सेप्ट है और इजी भी है ठीक है ये तो

play15:04

हो गया आपका बेसिक लेकिन अब एक और मेथड आप

play15:06

उसे करोगे स्ट्रिंग के अंदर कई बार वो

play15:08

होगा आपके प्रेम और एक और मेथड होता है वो

play15:11

है रिप्लेस अब ये ट्रिम और रिप्लेस मेथड

play15:13

कहां पे उसे आएगा देखिए क्या होगा की कई

play15:16

बार जैसे आपने बोला की न्यू स्ट्रिंग वैन

play15:20

है और आपने एक स्ट्रिंग डिफाइन कारी जिसके

play15:22

अंदर बहुत सारे स्पेस हैं फिर आपने लिखा

play15:25

है देश और फिर बहुत सारे स्पेस हैं इस तरह

play15:28

की स्ट्रिंग्स बहुत ही कॉमन ले आती है

play15:30

कहां पे आती है जब आप एक इनपुट फॉर्म

play15:32

बनाएंगे अपनी वेबसाइट पर तो कई बार क्या

play15:34

होता है यूजर डिलीवरी या अननोइंग्ली या

play15:37

फिर नो इंग्लिश बहुत सारे एक्स्ट्रा

play15:38

कैरेक्टर्स और स्पेशली स्पेस ऐड कर देता

play15:40

है वो स्पेशल कई बार हमें नहीं चाहिए होते

play15:43

हैं obbvious सी बात है पासवर्ड फुल में

play15:44

ऐसा नहीं करेंगे बट हान कई बार जैसे ईमेल

play15:47

दे रहा है तो वहां पे मुझे ये स्टार्टिंग

play15:49

के स्पेस ये लास्ट के स्पेस ये सब नहीं

play15:51

चाहिए मैं डेटाबेस में ये सब से नहीं करना

play15:53

चाहूंगा तो उसे केस में आपको कुछ भी नहीं

play15:55

करना है आप सिंपली देखेंगे कौन सा लोग हम

play15:57

इसको करके देखते हैं तो पहली बार तो हम

play16:00

कौन सा लॉक करते हैं इस न्यू स्ट्रिंग को

play16:01

और एक और कौन सा लॉक करते हैं

play16:08

अब इसको जब हम रन करते हैं तो आप नोटिस

play16:11

करेंगे फर्स्ट वाले के अंदर देखिए

play16:13

स्टार्टिंग स्पेस और यहां पे एंड स्पेस भी

play16:15

है लेकिन जो सेकंड वाला है उसके अंदर

play16:20

एक्सरसाइज को सिंपली रिमूव कर देता है अब

play16:23

इस ट्रिम के बारे में थोड़ा सा मैं आपको

play16:25

और इंटरेस्टिंग बताता हूं एक और चीज

play16:30

हवा स्क्रिप्ट और एमडीएम ऑफ कोर्स

play16:34

तो यहां पर आप जाएंगे तो अभी हमें मिल गया

play16:37

की ट्रिम इस तरह से उसे होता है लेकिन

play16:38

सबसे इंपॉर्टेंट चीज है यहां पे और इसका

play16:40

सिंटेक्स पढ़ना और भी वैल्यूज है जैसे

play16:42

ट्रिम स्टार्ट ट्रिम एंड अब इसको उसे करते

play16:44

हैं लोग ज्यादातर ट्रे में उसे करते हैं

play16:45

क्योंकि स्टार्ट और एंड दोनों का उसे कर

play16:47

लेता है तो नोटिस करिए इस तरह से ये उसे

play16:49

कर लेता है ब्राउज़र कंपैटिबिलिटी भी है

play16:51

और क्या-क्या ऑप्शंस आप देख सकते हैं

play16:52

प्लीज एक बार इस तरह से डॉक्यूमेंटेशन पे

play16:54

जाकर जरूर देखिएगा अब क्योंकि हम

play16:56

डॉक्यूमेंटेशन पे गए इसलिए आपको पता लगा

play16:58

की अच्छा ड्रीम स्टार्ट भी कोई चीज है और

play17:01

ट्रिम एंड भी कोई चीज है और नोटिस करिएगा

play17:03

ये व्हाइट स्पेस कैरेक्टर्स पे ही कम करता

play17:05

है लाइन टर्मिनेटर पे आप प्लस डी लाइन

play17:07

टर्मिनेटर मतलब जो न्यू लाइन स्लैश एन

play17:09

कैरक्टर आप उसे करते हैं तो इस तरह से जब

play17:11

आप डॉक्यूमेंटेशन पे जाते हैं तभी आपको कई

play17:13

बार नए मैथर्ड का पता लगता है हमें क्या

play17:15

नए मैथर्ड पता लगे स्टार्ट भी है और

play17:17

ट्रेंड भी है ठीक है वापस से आते हैं यहां

play17:19

पे ये तो हो गया हमारा ट्रिम का वैल्यू अब

play17:22

एक और वैल्यू आप उसे करेंगे जो की है कई

play17:24

बार रिप्लेस आप बताते हैं आपको उसका भी

play17:26

एग्जांपल कई बार क्या होगा जैसे की फॉर

play17:29

एग्जांपल एक आपके पास यूआरएल आया वो

play17:32

यूआरएल था कुछ

play17:34

सपोज करें एचटीटीपीएस

play17:39

और कोई और वेरिएबल hitesh.com ले लेते हैं

play17:42

चलिए उसके अंदर

play17:47

इस तरह की यूआरएल आपने काफी बार देखेंगे

play17:49

अब प्रॉब्लम क्या है की जो आपका ब्राउज़र

play17:52

है वो स्पेस नहीं समझता है अब किसी ने वेब

play17:55

पेज का नाम दे दिया है हितेश स्पेस चौधरी

play17:57

तो ब्राउज़र क्या करेगा ऑटोमेटेकली इसको

play17:59

कन्वर्ट कर देगा पर्सन 20 यू आर एलन

play18:01

कोडिंग में अब इस सिचुएशन में क्या होगा

play18:04

की आपको चाहिए की या ये जो चीज है यह

play18:06

रिमूव ओबेसिटी में करना चाहूंगा तो दो-तीन

play18:09

आपके पास मेथड से किस तरह से आप करना

play18:11

चाहेंगे या किस तरह से या सपोस करिए मुझे

play18:13

करना है की ये जो हितेश यूआरएल है इसी को

play18:15

मुझे कंपलीटली रिप्लेस करना है तो उन सारे

play18:17

केसेस में आप इसको चेंज कर सकते हैं तो

play18:19

जैसे यूआरएल है उसके अंदर आप दल सकते हैं

play18:22

डॉट रिप्लेस

play18:24

तो जैसे आप रिप्लेस देंगे तो इसको बोलेंगे

play18:26

क्या मैं सर्च करूं और किस मैं उसको

play18:28

रिप्लेस करूं तो सपोर्ट करिए की आप चाहते

play18:30

हैं की मैं इस पुरी स्ट्रिंग के अंदर

play18:32

ढूंढना चाहता हूं परसेंट 20 को और रिप्लेस

play18:34

करना चाहता हूं उसको

play18:38

तो कौन सा लॉक करके देखते हैं क्या वैल्यू

play18:40

आती है हमारे पास

play18:44

करते हैं और इसको रन करके देखते हैं तो

play18:47

मैंने रन कर तो ऑटोमेटेकली हितेश दश चौधरी

play18:50

हो गया वो तो अभी यूआरएल उसेबल है तो इस

play18:52

तरह के कुछ सेंटेंस जितना आप स्ट्रिंग के

play18:54

साथ फैमिलियर होंगे उतना आपको आगे जाके

play18:56

हेल्प मिलेगी बैक एंड डेवलपमेंट में फ्रंट

play18:58

एंड डेवलपमेंट क्योंकि आपको बस पता है की

play19:00

अच्छा ठीक है ये स्ट्रिंग ए गई मेरे पास

play19:02

अब मेरे को बहुत सारे मेथड पता है

play19:04

स्ट्रिंग के और मैं बहुत सारा से वैलिड

play19:06

ड्राइव कर सकता हूं ठीक है

play19:08

इतना ही नहीं आप इससे रिप्लेस नहीं आप

play19:11

इससे पूछ भी सकते हैं कुछ क्वेश्चंस जैसे

play19:13

की फॉर एग्जांपल

play19:15

यूआरएल डॉट इंक्लूड्स तो क्या यूआरएल के

play19:19

अंदर कुछ कीवर्ड्स हैं जैसे की हितेश है

play19:21

या नहीं तो इसके बारे में आप जान सकते हैं

play19:23

ऑब्वियस सी बात है कौन सा लोग हम कर लेते

play19:25

हैं यहां पे

play19:28

स्ट्रिंग्स सबसे ज्यादा पावरफुल होते हैं

play19:30

किसी भी लैंग्वेज में तो यहां पे ट्रू है

play19:32

लेकिन अगर आप पता करना चाहते हैं की इसके

play19:35

अंदर

play19:36

कुछ और जैसे की

play19:40

यह की वर्ड है या नहीं तो आप यह भी पूछ

play19:42

सकते हैं तो इसमें का फॉल्स यह नहीं है

play19:44

यहां पर अवेलेबल तो इस तरह के कुछ वैल्यूज

play19:46

है आप इजीली यहां पे देख सकते हैं अच्छा

play19:49

इसके अंदर बहुत सारे इंटरेस्टिंग चीज भी

play19:50

है जैसे सपोस करिए अभी मेरे पास एक

play19:52

स्ट्रिंग है यहां पे हितेश एफसी अब मैं

play19:56

चाहता हूं की जो स्ट्रिंग है कोई रीजन है

play19:58

पर ये स्ट्रिंग को मैं अरे में कन्वर्ट

play20:01

करना चाहता हूं बेस्ट किस पे क्योंकि ऐसे

play20:04

थोड़ी ना की कहीं से भी कुछ भी वैल्यू

play20:05

लेके ए रहा है मैं कन्वर्ट कर दूंगा मैं

play20:07

चाहता हूं की ऐसे जितने भी वैल्यूज हैं

play20:09

हितेश क डेड दश कॉम तो ये अलग पार्ट में

play20:12

स्प्लिट हो जाए बेस्ड ऑन दश बेस्ड ऑन किसी

play20:15

भी हो सकता है स्पेस भी हो सकता है दश भी

play20:17

हो सकता है कुछ भी हो सकता है तो ये सब

play20:19

कैसे करूंगा इसके लिए भी मेथड है ठीक है

play20:22

तो आपको दिखाते हैं तो सपोर्ट करिए आप

play20:24

इसको लॉक तो हम करेंगे करेंगे और

play20:27

गेम नहीं मैन गेम नाम हमने उसे कर था आप

play20:31

मेथड उसे कर सकते हैं स्प्लिट अब मेथड तो

play20:34

मैंने बता दिया स्प्लिट लेकिन मुझे उसे

play20:35

करना नहीं आता यह स्प्लिट कैसे उसे करूं

play20:37

तो सिंपली मैं जाऊंगा वापस से गूगल पे और

play20:39

इस बार बोलूंगा की मुझे बताओ ये स्प्लिट

play20:41

मेथड कैसे उसे करना है या फिर सपोज करिए

play20:43

आप यहां पे देख लेते हैं आपको इस प्लेट

play20:45

मेथड लगा बड़ा इंटरेस्टिंग की ये स्प्लिट

play20:47

जो है यहां पे ये बड़ा इंटरेस्टिंग है

play20:49

देखते हैं इसके अंदर क्या है इसके लेंथ तू

play20:51

है नाम स्प्लिट अरगुमेंट मुझे समझ नहीं ए

play20:53

रहा है तो मैंने बोला की ठीक है यहां पे

play20:55

जाते हैं स्प्लिट इसको देखते हैं कैसे तो

play20:58

इसने कहा की ये जो पूरा स्ट्रिंग है इस

play21:01

स्ट्रिंग को स्प्लिट करने के लिए स्पेस के

play21:03

बेस पर मैं स्ट्रिंग को स्प्लिट कर रहे

play21:04

हैं और यहां पर आउटपुट ले रहे हैं तो क्या

play21:07

आउटपुट आएगा हमारा तो हम तो चाहते हैं की

play21:09

पूरा ही मैं आउटपुट एक बार देखूं की

play21:11

स्प्लिट क्या आउटपुट दे रहा है तो आप चाहे

play21:13

तो यहां पे भी देख सकते हैं रन करके अभी

play21:15

तो आपको समझ में आएगी कैसे इसको उसे करते

play21:17

हैं आपको चाहिए सेपरेटर और एक लिमिट चलिए

play21:20

मैं लिमिट नहीं देता हूं मैं देता हूं

play21:21

सिर्फ यहां पर सेपरेटर ठीक है करके देखते

play21:24

हैं तो मेरे पास जो सेपरेटर है वो है

play21:26

सिंपली

play21:27

स्पेस भी हो सकता है बट मेरे पास दश देखते

play21:31

हैं वैल्यू क्या आता है उसका यहां पर

play21:34

जिसके अंदर तीन स्ट्रिंग्स है मैंने

play21:37

स्प्लिट कर बेसिस ऑन दश बट आप स्प्लिट कर

play21:40

सकते किसी पर अब ये तो हुआ थोड़ा सा बेसिक

play21:43

अब इसके अलावा और भी चीज हैं आप बहुत सारे

play21:46

स्ट्रिंग्स की वैल्यू भी निकल सकते हैं

play21:48

बहुत सारी और भी चीज जैसे यहां पे आप

play21:50

देखेंगे ये तो हमने स्प्लिट का बात कर

play21:51

स्मॉल मैंने कभी उसे ही नहीं कर मुझे पता

play21:54

भी नहीं है क्या होता है ऑनेस्टली बट बहुत

play21:56

सारे ऐसे मैथर्ड है तो मैं आपको सिर्फ

play21:58

इतना raycommend करूंगा की इस वीडियो के

play21:59

बाद आप जाइए थोड़ा सा आपको स्ट्रिंग के

play22:01

बारे में अब नॉलेज है थोड़ा सा एमडीएम का

play22:04

हेल्प लीजिए और थोड़ा सा यहां पर सिर्फ

play22:05

इसका हेल्प कीजिए की ब्लिंक क्या है बोल्ड

play22:08

क्या है कैरक्टर क्या है कॉन्टैक्ट क्या

play22:09

है कंस्ट्रक्टर क्या क्या करता है एंड्स

play22:11

की क्या करता है फिक्स क्या करता है अगर

play22:13

ये थोड़ा सा टाइम दे देंगे पंच से 10 मिनट

play22:15

ज्यादा नहीं 15 मिनट में हो जाएगा तो आपको

play22:18

स्ट्रिंग के अंदर बहुत ज्यादा expities

play22:19

मिलेगी एक चीज का बस ध्यान रखिएगा की

play22:22

स्ट्रिंग की प्रैक्टिस करनी पड़ेगी और

play22:23

दूसरी इंपॉर्टेंट चीज प्लीज प्लीज सेंड

play22:26

टेक्स्ट को फॉलो कीजिएगा बैक वाले को यह

play22:28

जो प्लस करके कमा करके यह सिंटेक्स बहुत

play22:31

पुराना हो गया कोई भी नए कोड में ऐसा नहीं

play22:33

लिखता है उम्मीद करता हूं आपको वीडियो

play22:34

पसंद आया होगा मुझे बनाने में बहुत मजा

play22:36

आया आपने ऑलरेडी सब्सक्राइब्ड हो फुल्ली

play22:38

कर दिया होगा और वीडियो को फैला दो सारे

play22:40

दोस्तों में चलिए मिलते हैं अगले वीडियो

play22:42

में

Rate This

5.0 / 5 (0 votes)

Related Tags
JavaScriptString ManipulationCoding TechniquesWeb DevelopmentBest PracticesCode OptimizationString MethodsProgramming TipsDeveloper GuideCode Modernization