String get all content between two characters
You can get content between symbols even there are other same characters. You can extract a string between two delimiters or two string or symbol.
Example:
Example:
String-> Some Text [Id-123]
Output-> Id-123
You can achieve same functionality with out using Regular expression. You can use String operaton.
For any programming like Java, JavaScript, C, C++, .Net, AngularJs, You can Use String operation.
String str = "Some Text [Id-123]";
String str2 = str.substring(str.lastIndexOf("[") + 1, str.lastIndexOf("]"));
Output-> Id-123
It will work for any symbol or characters.
Comments
Post a Comment