Can I get a function for this so that I can use every where in applicaiton . Please suggest

Not sure what you mean by function for this. When you want to use a string literal, you have to escape each single quote with another single quote. That applies only to string literals. So, for example, if you were to put the value into a variable, then you can use it everywhere without worrying about escaping like shown below.