Raw Strings in Java - for regex in particular. Multiline strings

前端 未结 12 1244
青春惊慌失措
青春惊慌失措 2020-12-01 02:13

Is there any way to use raw strings in Java (without escape sequences)?

(I\'m writing a fair amount of regex code and raw strings would make my code immensely more r

12条回答
  •  天命终不由人
    2020-12-01 02:18

    This is a work-around if you are using eclipse. You can automatically have long blocks of text correctly multilined and special characters automatically escaped when you paste text into a string literal

    "-paste here-";

    if you enable that option in window→preferences→java→Editor→Typing→"Escape text when pasting into a string literal"

提交回复
热议问题