Skip to content

Commit 51695c0

Browse files
committed
fix subString in dotnet
1 parent ab7ea92 commit 51695c0

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

  • dotnet_3/cs/rest/SCS/Imp

dotnet_3/cs/rest/SCS/Imp/Pat.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static string Subject(string txt, string pat)
4646
int j;
4747
if (txt[i] == pat[0])
4848
{
49-
possMatch = txt.Substring(i, i + patLen);
49+
possMatch = txt.Substring(i, patLen);
5050
if (possMatch.Equals(pat))
5151
{
5252
//FOUND pat
@@ -56,7 +56,8 @@ public static string Subject(string txt, string pat)
5656
{
5757
if (txt[j] == patRev[0])
5858
{
59-
possMatch = txt.Substring(j, j + patLen);
59+
//possMatch = txt.Substring(j, j + patLen);
60+
possMatch = txt.Substring(j, patLen);
6061
if (possMatch.Equals(patRev))
6162
{
6263
if (j == i + patLen)
@@ -74,7 +75,7 @@ public static string Subject(string txt, string pat)
7475
}
7576
else if (txt[i] == patRev[0])
7677
{
77-
possMatch = txt.Substring(i, i + patLen);
78+
possMatch = txt.Substring(i, patLen);
7879
if (possMatch.Equals(patRev))
7980
{
8081
//FOUND pat REVERSE
@@ -84,7 +85,7 @@ public static string Subject(string txt, string pat)
8485
{
8586
if (txt[j] == pat[0])
8687
{
87-
possMatch = txt.Substring(j, j + patLen);
88+
possMatch = txt.Substring(j, patLen);
8889
if (possMatch.Equals(pat))
8990
{
9091
if (j == i + patLen)

0 commit comments

Comments
 (0)