Advertisements
Advertisements
प्रश्न
Differentiate between charAt() and substring().
अंतर स्पष्ट करें
उत्तर
S. No. | charAt() | substring() |
1. | Returns a character in the String at the nth place, counting from the 0th position. | This function extracts a set of characters from a specified index up to the end of a string. |
2. |
Example:
|
Example:
|
3. | In the above example, t is printed. | In the above example, BspAcp is printed. |
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 4: String Handling - EXERCISES [पृष्ठ २८९]