+ Start a Discussion

line breaks not allowed in string literals error

I am taking String s ='aa\aa'; and tried to run in developer console, it shows the following error as Invalid string literal 'aa\aa'. Illegal character sequence '\a' in string literal.,,  but i want to save this in object as a record .. how can i do that? 


Try this

String s = 'aa'+'\\'+'aa';
Bhawani SharmaBhawani Sharma
Use String s ='aa\\aa';
This will be saved as you want.

Testing4 (Testing/500)


I have a string some thing like this i need to


Testing/123( testing/2345   i want 2345 value  to be displayed any help