How to remove all characters before a specific character in Java?

You can use .substring(): String s = “the text=text”; String s1 = s.substring(s.indexOf(“=”) + 1); s1.trim(); then s1 contains everything after = in the original string. s1.trim() .trim() removes spaces before the first character (which isn’t a whitespace, such as letters, numbers etc.) of a string (leading spaces) and also removes spaces after the last … Read more

Multiple REPLACE function in Oracle

Even if this thread is old is the first on Google, so I’ll post an Oracle equivalent to the function implemented here, using regular expressions. Is fairly faster than nested replace(), and much cleaner. To replace strings ‘a’,’b’,’c’ with ‘d’ in a string column from a given table select regexp_replace(string_col,’a|b|c’,’d’) from given_table It is nothing … Read more

regex string replace

This should work : str = str.replace(/[^a-z0-9-]/g, ”); Everything between the indicates what your are looking for / is here to delimit your pattern so you have one to start and one to end [] indicates the pattern your are looking for on one specific character ^ indicates that you want every character NOT corresponding … Read more