Posts

Showing posts with the label string methods java

Java Strings – Working with Text in Java जावा स्ट्रिंग्स

In Java, a string is a sequence of characters. For example, "Java Book" is a string. Strings in Java are defined as objects so that various operations can be performed on them like concatenation, comparison, and extraction. The String class allows us to create string variables or objects and perform operations on them. जावा में, एक स्ट्रिंग अक्षरों (characters) का एक क्रम होती है। जैसे कि "जावा की किताब" एक स्ट्रिंग है। जावा में स्ट्रिंग को ऑब्जेक्ट के रूप में परिभाषित किया गया है ताकि हम उस पर विभिन्न ऑपरेशन्स जैसे जोड़ना, तुलना करना आदि कर सकें। String क्लास की मदद से हम सामान्य स्ट्रिंग वेरिएबल या ऑब्जेक्ट बना सकते हैं और उन पर ऑपरेशन कर सकते हैं। String myString = "this is a string"; // variable String myString = new String("This is a string"); // object ✨ Common Methods of Java String Class जावा स्ट्रिंग क्लास की सामान्य मेथड्स: 1. equals() – String Comparison Used to compare two strings. If they are equal, it returns true . दो ...