如何在Java中使用字符串文字
本文关键字:字符串 文字 Java | 更新日期: 2023-09-27 18:05:46
string s = @"This is the first line.
and this is the second line without escapes
and another one joins the fuss";
我们在c#中这样做,添加一个@用于将文本赋值给不带转义字符的字符串。
现在我要在Java中做这个&我是Java的新手。谁能告诉我如何在Java中做同样的事情?
p。我知道这是个糟糕的问题,但是请耐心听我说……从下面你就会知道为什么这对我如此重要
INSERT INTO `timetable` (`ID`, `teacherID`, `courseID`, `dayOfWeek`, `startTime`, `endTime`, `Block`, `RoomNo`, `isSynchronized`) VALUES
(1, 1, 'CS105', 1, '08:00:00', '09:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(2, 1, 'CS105', 1, '09:00:00', '10:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(3, 1, 'CS105', 1, '10:00:00', '11:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(4, 1, 'CS105', 1, '11:00:00', '12:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(5, 1, 'CS105', 1, '12:00:00', '13:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(6, 1, 'CS105', 1, '13:00:00', '14:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(7, 1, 'CS105', 1, '14:00:00', '15:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(8, 1, 'CS105', 1, '15:00:00', '16:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(9, 1, 'CS105', 1, '16:00:00', '17:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(10, 1, 'CS105', 2, '08:00:00', '09:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(11, 1, 'CS105', 2, '09:00:00', '10:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(12, 1, 'CS105', 2, '10:00:00', '11:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(13, 1, 'CS105', 2, '11:00:00', '12:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(14, 1, 'CS105', 2, '12:00:00', '13:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(15, 1, 'CS105', 2, '13:00:00', '14:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(16, 1, 'CS105', 2, '14:00:00', '15:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(17, 1, 'CS105', 2, '15:00:00', '16:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(18, 1, 'CS105', 2, '16:00:00', '17:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(19, 1, 'CS105', 3, '08:00:00', '09:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(20, 1, 'CS105', 3, '09:00:00', '10:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(21, 1, 'CS105', 3, '10:00:00', '11:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(22, 1, 'CS105', 3, '11:00:00', '12:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(23, 1, 'CS105', 3, '12:00:00', '13:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(24, 1, 'CS105', 3, '13:00:00', '14:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(25, 1, 'CS105', 3, '14:00:00', '15:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(26, 1, 'CS105', 3, '15:00:00', '16:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(27, 1, 'CS105', 3, '16:00:00', '17:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(28, 1, 'CS105', 4, '08:00:00', '09:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(29, 1, 'CS105', 4, '09:00:00', '10:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(30, 1, 'CS105', 4, '10:00:00', '11:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(31, 1, 'CS105', 4, '11:00:00', '12:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(32, 1, 'CS105', 4, '12:00:00', '13:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(33, 1, 'CS105', 4, '13:00:00', '14:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(34, 1, 'CS105', 4, '14:00:00', '15:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(35, 1, 'CS105', 4, '15:00:00', '16:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(36, 1, 'CS105', 4, '16:00:00', '17:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(37, 1, 'CS105', 5, '08:00:00', '09:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(38, 1, 'CS105', 5, '09:00:00', '10:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(39, 1, 'CS105', 5, '10:00:00', '11:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(40, 1, 'CS105', 5, '11:00:00', '12:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(41, 1, 'CS105', 5, '12:00:00', '13:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(42, 1, 'CS105', 5, '13:00:00', '14:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(43, 1, 'CS105', 5, '14:00:00', '15:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(44, 1, 'CS105', 5, '15:00:00', '16:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(45, 1, 'CS105', 5, '16:00:00', '17:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(46, 1, 'CS105', 6, '08:00:00', '09:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(47, 1, 'CS105', 6, '09:00:00', '10:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(48, 1, 'CS105', 6, '10:00:00', '11:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(49, 1, 'CS105', 6, '11:00:00', '12:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(50, 1, 'CS105', 6, '12:00:00', '13:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(51, 1, 'CS105', 6, '13:00:00', '14:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(52, 1, 'CS105', 6, '14:00:00', '15:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(53, 1, 'CS105', 6, '15:00:00', '16:00:00', 'Allama Iqbal Block', 'LH-786', 0),
(54, 1, 'CS105', 6, '16:00:00', '17:00:00', 'Allama Iqbal Block', 'LH-786', 0);
还有很多,我不能花一整天的时间把它们转换成一行。
Java中没有字符串字量