私のrichtexBox1には以下の文がありますが、文がCreate tableで始まりセミコロンで終わる場合、各行の間に1行だけスペースを空け、行間を空けないでください。
結果:
ALTER TABLE "COURSE" DROP CONSTRAINT "CRSE_CRSE_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_STU_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_SECT_FK";
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_STU_FK" FOREIGN KEY ("STUDENT_ID") REFERENCES "STUDENT"("STUDENT_ID") ENABLE;
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_SECT_FK" FOREIGN KEY ("SECTION_ID") REFERENCES "SECTION"("SECTION_ID") ENABLE;
CREATE TABLE "COMP1"
( "EMPID" NUMBER,
"EMPLNAME" VARCHAR2(20),
"EMPFNAME" VARCHAR2(20),
"DEPTNO" NUMBER,
"MGRID" NUMBER,
PRIMARY KEY ("EMPID") ENABLE
);
CREATE TABLE "COMP12"
( "EMPID" NUMBER,
"EMPLNAME" VARCHAR2(20),
"EMPFNAME" VARCHAR2(20),
"DEPTNO" NUMBER,
"MGRID" NUMBER,
PRIMARY KEY ("EMPID") ENABLE
);
期待される結果
ALTER TABLE "COURSE" DROP CONSTRAINT "CRSE_CRSE_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_STU_FK";
ALTER TABLE "ENROLLMENT" DROP CONSTRAINT "ENR_SECT_FK";
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_STU_FK" FOREIGN KEY ("STUDENT_ID") REFERENCES "STUDENT"("STUDENT_ID") ENABLE;
ALTER TABLE "ENROLLMENT" ADD CONSTRAINT "ENR_SECT_FK" FOREIGN KEY ("SECTION_ID") REFERENCES "SECTION"("SECTION_ID") ENABLE;
CREATE TABLE "COMP1"
( "EMPID" NUMBER,
"EMPLNAME" VARCHAR2(20),
"EMPFNAME" VARCHAR2(20),
"DEPTNO" NUMBER,
"MGRID" NUMBER,
PRIMARY KEY ("EMPID") ENABLE
);
CREATE TABLE "COMP12"
( "EMPID" NUMBER,
"EMPLNAME" VARCHAR2(20),
"EMPFNAME" VARCHAR2(20),
"DEPTNO" NUMBER,
"MGRID" NUMBER,
PRIMARY KEY ("EMPID") ENABLE
);
マイ コード (空行を 2 行追加するだけ)
List<string> rt = new List<string>();
foreach (string line in richtexBox1 .Lines)
{
if (line != "")
{
rt.Add(line);
rt.Add("");
}
}
richtexBox1 .Lines = rt.ToArray();