From 5c4d62cea7062bf8765a17db7aa709fddce8aff9 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 09:57:22 +0800 Subject: [PATCH 01/16] Implement StringService with various text operations --- StringService.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 StringService.cs diff --git a/StringService.cs b/StringService.cs new file mode 100644 index 0000000..c281f9b --- /dev/null +++ b/StringService.cs @@ -0,0 +1,56 @@ +public class StringService +{ + private string originalText = ""; + private string currentText = ""; + + public void SetText(string text) + { + originalText = text; + currentText = text; + } + + public string GetCurrentText() + { + return currentText; + } + + public void ToUpperCase() + { + currentText = currentText.ToUpper(); + } + + public void ToLowerCase() + { + currentText = currentText.ToLower(); + } + + public int CountCharacters() + { + return currentText.Length; + } + + public bool ContainsWord(string word) + { + return currentText.Contains(word); + } + + public void ReplaceWord(string oldWord, string newWord) + { + currentText = currentText.Replace(oldWord, newWord); + } + + public void ExtractSubstring(int start, int length) + { + currentText = currentText.Substring(start, length); + } + + public void TrimSpaces() + { + currentText = currentText.Trim(); + } + + public void ResetText() + { + currentText = originalText; + } +} From e35cd352d9cb4524ef15c0e6fbef6b53fbcc7481 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 09:58:54 +0800 Subject: [PATCH 02/16] Create StringService.cs file with basic string manipulation methods --- Services/StringService.cs | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Services/StringService.cs diff --git a/Services/StringService.cs b/Services/StringService.cs new file mode 100644 index 0000000..3e8c002 --- /dev/null +++ b/Services/StringService.cs @@ -0,0 +1,56 @@ +public class StringService +{ + private string originalText = ""; + private string currentText = ""; + + public void SetText(string text) + { + originalText = text; + currentText = text; + } + + public string GetCurrentText() + { + return currentText; + } + + public void ToUpperCase() + { + currentText = currentText.ToUpper(); + } + + public void ToLowerCase() + { + currentText = currentText.ToLower(); + } + + public int CountCharacters() + { + return currentText.Length; + } + + public bool ContainsWord(string word) + { + return currentText.Contains(word); + } + + public void ReplaceWord(string oldWord, string newWord) + { + currentText = currentText.Replace(oldWord, newWord); + } + + public void ExtractSubstring(int start, int length) + { + currentText = currentText.Substring(start, length); + } + + public void TrimSpaces() + { + currentText = currentText.Trim(); + } + + public void ResetText() + { + currentText = originalText; + } +} \ No newline at end of file From 8731fec214199d2d37d2d1f28117185359a6a924 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 10:00:16 +0800 Subject: [PATCH 03/16] Delete StringService.cs --- StringService.cs | 56 ------------------------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 StringService.cs diff --git a/StringService.cs b/StringService.cs deleted file mode 100644 index c281f9b..0000000 --- a/StringService.cs +++ /dev/null @@ -1,56 +0,0 @@ -public class StringService -{ - private string originalText = ""; - private string currentText = ""; - - public void SetText(string text) - { - originalText = text; - currentText = text; - } - - public string GetCurrentText() - { - return currentText; - } - - public void ToUpperCase() - { - currentText = currentText.ToUpper(); - } - - public void ToLowerCase() - { - currentText = currentText.ToLower(); - } - - public int CountCharacters() - { - return currentText.Length; - } - - public bool ContainsWord(string word) - { - return currentText.Contains(word); - } - - public void ReplaceWord(string oldWord, string newWord) - { - currentText = currentText.Replace(oldWord, newWord); - } - - public void ExtractSubstring(int start, int length) - { - currentText = currentText.Substring(start, length); - } - - public void TrimSpaces() - { - currentText = currentText.Trim(); - } - - public void ResetText() - { - currentText = originalText; - } -} From 378757546070f8c8c6eab9dd6e227c8f08bbab2b Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 10:42:53 +0800 Subject: [PATCH 04/16] Implement StringView class for text processing --- StringView.cs | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 StringView.cs diff --git a/StringView.cs b/StringView.cs new file mode 100644 index 0000000..7d6da93 --- /dev/null +++ b/StringView.cs @@ -0,0 +1,95 @@ +public class StringView +{ + private StringService service = new StringService(); + + public void Run() + { + bool running = true; + + while(running) + { + DisplayMenu(); + string choice = Console.ReadLine(); + + switch(choice) + { + case "1": + Console.Write("Enter text: "); + string text = Console.ReadLine(); + service.SetText(text); + break; + + case "2": + Console.WriteLine("Current Text: "+ service.GetCurrentText()); + break; + + case "3": + service.ToUpperCase(); + break; + + case "4": + service.ToLowerCase(); + break; + + case "5": + Console.WriteLine("Character count: "+ service.CountCharacters()); + break; + + case "6": + Console.Write("Enter word to check: "); + string word = Console.ReadLine(); + Console.WriteLine(service.ContainsWord(word)); + break; + + case "7": + Console.Write("Word to replace: "); + string oldWord = Console.ReadLine(); + Console.Write("New word: "); + string newWord = Console.ReadLine(); + service.ReplaceWord(oldWord, newWord); + break; + + case "8": + Console.Write("Start index: "); + int start = int.Parse(Console.ReadLine()); + Console.Write("Length: "); + int length = int.Parse(Console.ReadLine()); + service.ExtractSubstring(start, length); + break; + + case "9": + service.TrimSpaces(); + break; + + case "10": + service.ResetText(); + break; + + case "11": + running = false; + break; + + } + } + } + + private void DisplayMenu() + { + Console.WriteLine("\n STRING PROCESSING SYSTEM "); + Console.WriteLine("1. Enter Text"); + Console.WriteLine("2. View Current Text"); + Console.WriteLine("3. Convert to Uppercase"); + Console.WriteLine("4. Convert to Lowercase"); + Console.WriteLine("5. Count characters"); + Console.WriteLine("6. Check if it contains word"); + Console.WriteLine("7. Replace word"); + Console.WriteLine("8. Extract Substring"); + Console.WriteLine("9. Trim Spaces"); + Console.WriteLine("10. Reset text"); + Console.WriteLine("11. Exit"); + Console.WriteLine("Choose option: "); + } +} + + + From 738fe570a4ac522d2104c797c2777ff41d8ae9b6 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 10:43:52 +0800 Subject: [PATCH 05/16] Move StringView.cs into Views folder --- Views/StringView.cs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Views/StringView.cs diff --git a/Views/StringView.cs b/Views/StringView.cs new file mode 100644 index 0000000..2924604 --- /dev/null +++ b/Views/StringView.cs @@ -0,0 +1,8 @@ +// Contents of StringView.cs from commit 378757546070f8c8c6eab9dd6e227c8f08bbab2b +// Assuming contents are accurately fetched as per your request; insert actual content here. + +namespace YourNamespace { + public class StringView { + // Class implementation goes here... + } +} \ No newline at end of file From e673fa7ea93c17422b847cd1ae15befff9ab6330 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 10:44:40 +0800 Subject: [PATCH 06/16] Delete StringView.cs --- StringView.cs | 95 --------------------------------------------------- 1 file changed, 95 deletions(-) delete mode 100644 StringView.cs diff --git a/StringView.cs b/StringView.cs deleted file mode 100644 index 7d6da93..0000000 --- a/StringView.cs +++ /dev/null @@ -1,95 +0,0 @@ -public class StringView -{ - private StringService service = new StringService(); - - public void Run() - { - bool running = true; - - while(running) - { - DisplayMenu(); - string choice = Console.ReadLine(); - - switch(choice) - { - case "1": - Console.Write("Enter text: "); - string text = Console.ReadLine(); - service.SetText(text); - break; - - case "2": - Console.WriteLine("Current Text: "+ service.GetCurrentText()); - break; - - case "3": - service.ToUpperCase(); - break; - - case "4": - service.ToLowerCase(); - break; - - case "5": - Console.WriteLine("Character count: "+ service.CountCharacters()); - break; - - case "6": - Console.Write("Enter word to check: "); - string word = Console.ReadLine(); - Console.WriteLine(service.ContainsWord(word)); - break; - - case "7": - Console.Write("Word to replace: "); - string oldWord = Console.ReadLine(); - Console.Write("New word: "); - string newWord = Console.ReadLine(); - service.ReplaceWord(oldWord, newWord); - break; - - case "8": - Console.Write("Start index: "); - int start = int.Parse(Console.ReadLine()); - Console.Write("Length: "); - int length = int.Parse(Console.ReadLine()); - service.ExtractSubstring(start, length); - break; - - case "9": - service.TrimSpaces(); - break; - - case "10": - service.ResetText(); - break; - - case "11": - running = false; - break; - - } - } - } - - private void DisplayMenu() - { - Console.WriteLine("\n STRING PROCESSING SYSTEM "); - Console.WriteLine("1. Enter Text"); - Console.WriteLine("2. View Current Text"); - Console.WriteLine("3. Convert to Uppercase"); - Console.WriteLine("4. Convert to Lowercase"); - Console.WriteLine("5. Count characters"); - Console.WriteLine("6. Check if it contains word"); - Console.WriteLine("7. Replace word"); - Console.WriteLine("8. Extract Substring"); - Console.WriteLine("9. Trim Spaces"); - Console.WriteLine("10. Reset text"); - Console.WriteLine("11. Exit"); - Console.WriteLine("Choose option: "); - } -} - - - From af59ef725ae42502a308a2953107148f92a10968 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 10:50:04 +0800 Subject: [PATCH 07/16] Create Program.cs --- Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Program.cs diff --git a/Program.cs b/Program.cs new file mode 100644 index 0000000..0496be7 --- /dev/null +++ b/Program.cs @@ -0,0 +1,13 @@ +/* +Name: Staley Lane T. Cardeno +Date: 2/28/2026 +Project Description: A console based string-processing system that allows users to input text and perform various string operations using built-in C# String methods. +**/ + +class Program +{ + static void Main(string[] args) + { + StringView view = new StringView(); + view.Run(); + } From 46616074cf26faea5ddf2ee43000bec953fb866b Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:02:20 +0800 Subject: [PATCH 08/16] Create sample --- StringProcessingApp/sample | 1 + 1 file changed, 1 insertion(+) create mode 100644 StringProcessingApp/sample diff --git a/StringProcessingApp/sample b/StringProcessingApp/sample new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/StringProcessingApp/sample @@ -0,0 +1 @@ + From 92b5eacbbb9d61d875ed6b4a7354696bf784b3ff Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:13:45 +0800 Subject: [PATCH 09/16] Rename Program.cs to StringProcessingApp/Program.cs --- Program.cs => StringProcessingApp/Program.cs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Program.cs => StringProcessingApp/Program.cs (100%) diff --git a/Program.cs b/StringProcessingApp/Program.cs similarity index 100% rename from Program.cs rename to StringProcessingApp/Program.cs From 21051d506411c8a58b2384c855145c228163b1cc Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:14:05 +0800 Subject: [PATCH 10/16] Delete StringProcessingApp/sample --- StringProcessingApp/sample | 1 - 1 file changed, 1 deletion(-) delete mode 100644 StringProcessingApp/sample diff --git a/StringProcessingApp/sample b/StringProcessingApp/sample deleted file mode 100644 index 8b13789..0000000 --- a/StringProcessingApp/sample +++ /dev/null @@ -1 +0,0 @@ - From 700d92427d2f16bd7eb3b7dda7467b0788f95fc9 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:30:49 +0800 Subject: [PATCH 11/16] Rename Services/StringService.cs to Services/StringProcessingApp/Services/StringService.cs --- Services/{ => StringProcessingApp/Services}/StringService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Services/{ => StringProcessingApp/Services}/StringService.cs (99%) diff --git a/Services/StringService.cs b/Services/StringProcessingApp/Services/StringService.cs similarity index 99% rename from Services/StringService.cs rename to Services/StringProcessingApp/Services/StringService.cs index 3e8c002..c281f9b 100644 --- a/Services/StringService.cs +++ b/Services/StringProcessingApp/Services/StringService.cs @@ -53,4 +53,4 @@ public void ResetText() { currentText = originalText; } -} \ No newline at end of file +} From dd1398badb435d903411878bae7b27d199846b05 Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:31:40 +0800 Subject: [PATCH 12/16] Rename Services/StringProcessingApp/Services/StringService.cs to Services/StringProcessingApp/Services/Services/StringService.cs --- .../StringProcessingApp/Services/{ => Services}/StringService.cs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Services/StringProcessingApp/Services/{ => Services}/StringService.cs (100%) diff --git a/Services/StringProcessingApp/Services/StringService.cs b/Services/StringProcessingApp/Services/Services/StringService.cs similarity index 100% rename from Services/StringProcessingApp/Services/StringService.cs rename to Services/StringProcessingApp/Services/Services/StringService.cs From b86263aa02ae4108c14ff508f3c14112d018461d Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:35:33 +0800 Subject: [PATCH 13/16] Delete Services/StringProcessingApp/Services/Services directory --- .../Services/Services/StringService.cs | 56 ------------------- 1 file changed, 56 deletions(-) delete mode 100644 Services/StringProcessingApp/Services/Services/StringService.cs diff --git a/Services/StringProcessingApp/Services/Services/StringService.cs b/Services/StringProcessingApp/Services/Services/StringService.cs deleted file mode 100644 index c281f9b..0000000 --- a/Services/StringProcessingApp/Services/Services/StringService.cs +++ /dev/null @@ -1,56 +0,0 @@ -public class StringService -{ - private string originalText = ""; - private string currentText = ""; - - public void SetText(string text) - { - originalText = text; - currentText = text; - } - - public string GetCurrentText() - { - return currentText; - } - - public void ToUpperCase() - { - currentText = currentText.ToUpper(); - } - - public void ToLowerCase() - { - currentText = currentText.ToLower(); - } - - public int CountCharacters() - { - return currentText.Length; - } - - public bool ContainsWord(string word) - { - return currentText.Contains(word); - } - - public void ReplaceWord(string oldWord, string newWord) - { - currentText = currentText.Replace(oldWord, newWord); - } - - public void ExtractSubstring(int start, int length) - { - currentText = currentText.Substring(start, length); - } - - public void TrimSpaces() - { - currentText = currentText.Trim(); - } - - public void ResetText() - { - currentText = originalText; - } -} From e559c3e925e968fbe81526ff6033bbf644d3c51c Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:36:55 +0800 Subject: [PATCH 14/16] Create StringService.cs --- StringProcessingApp/Services/StringService.cs | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 StringProcessingApp/Services/StringService.cs diff --git a/StringProcessingApp/Services/StringService.cs b/StringProcessingApp/Services/StringService.cs new file mode 100644 index 0000000..c281f9b --- /dev/null +++ b/StringProcessingApp/Services/StringService.cs @@ -0,0 +1,56 @@ +public class StringService +{ + private string originalText = ""; + private string currentText = ""; + + public void SetText(string text) + { + originalText = text; + currentText = text; + } + + public string GetCurrentText() + { + return currentText; + } + + public void ToUpperCase() + { + currentText = currentText.ToUpper(); + } + + public void ToLowerCase() + { + currentText = currentText.ToLower(); + } + + public int CountCharacters() + { + return currentText.Length; + } + + public bool ContainsWord(string word) + { + return currentText.Contains(word); + } + + public void ReplaceWord(string oldWord, string newWord) + { + currentText = currentText.Replace(oldWord, newWord); + } + + public void ExtractSubstring(int start, int length) + { + currentText = currentText.Substring(start, length); + } + + public void TrimSpaces() + { + currentText = currentText.Trim(); + } + + public void ResetText() + { + currentText = originalText; + } +} From 9b629480848e3f6d6f885d12619aef8b13c43dab Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:39:33 +0800 Subject: [PATCH 15/16] Create StringView.cs --- StringProcessingApp/Views/StringView.cs | 91 +++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 StringProcessingApp/Views/StringView.cs diff --git a/StringProcessingApp/Views/StringView.cs b/StringProcessingApp/Views/StringView.cs new file mode 100644 index 0000000..d04cfd4 --- /dev/null +++ b/StringProcessingApp/Views/StringView.cs @@ -0,0 +1,91 @@ +public class StringView +{ + private StringService service = new StringService(); + + public void Run() + { + bool running = true; + + while (running) + { + DisplayMenu(); + string choice = Console.ReadLine(); + + switch (choice) + { + case "1": + Console.Write("Enter text: "); + string text = Console.ReadLine(); + service.SetText(text); + break; + + case "2": + Console.WriteLine("Current Text: " + service.GetCurrentText()); + break; + + case "3": + service.ToUpperCase(); + break; + + case "4": + service.ToLowerCase(); + break; + + case "5": + Console.WriteLine("Character Count: " + service.CountCharacters()); + break; + + case "6": + Console.Write("Enter word to check: "); + string word = Console.ReadLine(); + Console.WriteLine(service.ContainsWord(word)); + break; + + case "7": + Console.Write("Word to replace: "); + string oldWord = Console.ReadLine(); + Console.Write("New word: "); + string newWord = Console.ReadLine(); + service.ReplaceWord(oldWord, newWord); + break; + + case "8": + Console.Write("Start index: "); + int start = int.Parse(Console.ReadLine()); + Console.Write("Length: "); + int length = int.Parse(Console.ReadLine()); + service.ExtractSubstring(start, length); + break; + + case "9": + service.TrimSpaces(); + break; + + case "10": + service.ResetText(); + break; + + case "11": + running = false; + break; + } + } + } + + private void DisplayMenu() + { + Console.WriteLine("\n--- STRING PROCESSING SYSTEM ---"); + Console.WriteLine("1. Enter Text"); + Console.WriteLine("2. View Current Text"); + Console.WriteLine("3. Convert to UPPERCASE"); + Console.WriteLine("4. Convert to lowercase"); + Console.WriteLine("5. Count Characters"); + Console.WriteLine("6. Check if Contains Word"); + Console.WriteLine("7. Replace Word"); + Console.WriteLine("8. Extract Substring"); + Console.WriteLine("9. Trim Spaces"); + Console.WriteLine("10. Reset Text"); + Console.WriteLine("11. Exit"); + Console.Write("Choose option: "); + } +} From 8de9f1fa92eabcf0f524e53af9f880d8181c34bd Mon Sep 17 00:00:00 2001 From: Staley Date: Sat, 28 Feb 2026 11:39:49 +0800 Subject: [PATCH 16/16] Delete Views directory --- Views/StringView.cs | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 Views/StringView.cs diff --git a/Views/StringView.cs b/Views/StringView.cs deleted file mode 100644 index 2924604..0000000 --- a/Views/StringView.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Contents of StringView.cs from commit 378757546070f8c8c6eab9dd6e227c8f08bbab2b -// Assuming contents are accurately fetched as per your request; insert actual content here. - -namespace YourNamespace { - public class StringView { - // Class implementation goes here... - } -} \ No newline at end of file