From c4653b7e701d6d45e71bc1433bde5d29baf330bd Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:22:41 +0800 Subject: [PATCH 01/11] Create StringProccessingApp --- StringProccessingApp | 1 + 1 file changed, 1 insertion(+) create mode 100644 StringProccessingApp diff --git a/StringProccessingApp b/StringProccessingApp new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/StringProccessingApp @@ -0,0 +1 @@ + From 9a5e8ebe36fcd268cdc478b1dd697e8d0eb61171 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:26:16 +0800 Subject: [PATCH 02/11] Delete StringProccessingApp --- StringProccessingApp | 1 - 1 file changed, 1 deletion(-) delete mode 100644 StringProccessingApp diff --git a/StringProccessingApp b/StringProccessingApp deleted file mode 100644 index 8b13789..0000000 --- a/StringProccessingApp +++ /dev/null @@ -1 +0,0 @@ - From 32825c4c93034d818df478e465ac6438f145f796 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:29:44 +0800 Subject: [PATCH 03/11] Create Program.cs --- StringProcessingApp./Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 StringProcessingApp./Program.cs diff --git a/StringProcessingApp./Program.cs b/StringProcessingApp./Program.cs new file mode 100644 index 0000000..10ca473 --- /dev/null +++ b/StringProcessingApp./Program.cs @@ -0,0 +1,13 @@ +using StringProcessingApp.Views; + +namespace StringProcessingApp +{ + class Program + { + static void Main(string[] args) + { + StringView view = new StringView(); + view.Run(); + } + } +} From ecb30ecd7c6bef0df6f2231781f8ae1321ef477e Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:30:25 +0800 Subject: [PATCH 04/11] Delete StringProcessingApp. directory --- StringProcessingApp./Program.cs | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 StringProcessingApp./Program.cs diff --git a/StringProcessingApp./Program.cs b/StringProcessingApp./Program.cs deleted file mode 100644 index 10ca473..0000000 --- a/StringProcessingApp./Program.cs +++ /dev/null @@ -1,13 +0,0 @@ -using StringProcessingApp.Views; - -namespace StringProcessingApp -{ - class Program - { - static void Main(string[] args) - { - StringView view = new StringView(); - view.Run(); - } - } -} From 0ef6ca97872f3218e8b994e5873eee641afbc43d Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:31:00 +0800 Subject: [PATCH 05/11] Add main program to run StringView --- StringProcessingApp/Program.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 StringProcessingApp/Program.cs diff --git a/StringProcessingApp/Program.cs b/StringProcessingApp/Program.cs new file mode 100644 index 0000000..10ca473 --- /dev/null +++ b/StringProcessingApp/Program.cs @@ -0,0 +1,13 @@ +using StringProcessingApp.Views; + +namespace StringProcessingApp +{ + class Program + { + static void Main(string[] args) + { + StringView view = new StringView(); + view.Run(); + } + } +} From ea3a027d6856d34579beea0e4bf6aa8d98db55c4 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:32:42 +0800 Subject: [PATCH 06/11] Add StringService with text manipulation methods Implemented various string manipulation methods including ToUpperCase, ToLowerCase, CountCharacters, ContainsWord, ReplaceWord, ExtractSubstring, TrimSpaces, and ResetText. --- StringProcessingApp/Services/StringService.cs | 69 +++++++++++++++++++ 1 file changed, 69 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..359b9aa --- /dev/null +++ b/StringProcessingApp/Services/StringService.cs @@ -0,0 +1,69 @@ +namespace StringProcessingApp.Services +{ + public class StringService + { + private string originalText = ""; + private string currentText = ""; + + // Set new text + public void SetText(string text) + { + originalText = text; + currentText = text; + } + + // Get current text + public string GetText() + { + return currentText; + } + + // Convert to uppercase + public void ToUpperCase() + { + currentText = currentText.ToUpper(); + } + + // Convert to lowercase + public void ToLowerCase() + { + currentText = currentText.ToLower(); + } + + // Count characters + public int CountCharacters() + { + return currentText.Length; + } + + // Check if contains word + public bool ContainsWord(string word) + { + return currentText.Contains(word); + } + + // Replace word + public void ReplaceWord(string oldWord, string newWord) + { + currentText = currentText.Replace(oldWord, newWord); + } + + // Extract substring + public string ExtractSubstring(int startIndex, int length) + { + return currentText.Substring(startIndex, length); + } + + // Trim spaces + public void TrimSpaces() + { + currentText = currentText.Trim(); + } + + // Reset to original + public void ResetText() + { + currentText = originalText; + } + } +} From 7610189b2a36b1d993082e2928065e77aa54ce52 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:34:35 +0800 Subject: [PATCH 07/11] Add StringView class for string processing interface --- StringProcessingApp/Service/StringView.cs | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 StringProcessingApp/Service/StringView.cs diff --git a/StringProcessingApp/Service/StringView.cs b/StringProcessingApp/Service/StringView.cs new file mode 100644 index 0000000..32d86bd --- /dev/null +++ b/StringProcessingApp/Service/StringView.cs @@ -0,0 +1,121 @@ +using System; +using StringProcessingApp.Services; + +namespace StringProcessingApp.Views +{ + public class StringView + { + private StringService service = new StringService(); + private bool isRunning = true; + + public void Run() + { + while (isRunning) + { + ShowMenu(); + Console.Write("Choose option: "); + string choice = Console.ReadLine(); + + HandleChoice(choice); + } + } + + private void ShowMenu() + { + 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"); + } + + private void HandleChoice(string choice) + { + switch (choice) + { + case "1": + Console.Write("Enter text: "); + string input = Console.ReadLine(); + service.SetText(input); + break; + + case "2": + Console.WriteLine("Current Text: " + service.GetText()); + break; + + case "3": + service.ToUpperCase(); + Console.WriteLine("Converted to UPPERCASE."); + break; + + case "4": + service.ToLowerCase(); + Console.WriteLine("Converted to lowercase."); + break; + + case "5": + Console.WriteLine("Character Count: " + service.CountCharacters()); + break; + + case "6": + Console.Write("Enter word to check: "); + string word = Console.ReadLine(); + bool contains = service.ContainsWord(word); + Console.WriteLine("Contains word? " + contains); + break; + + case "7": + Console.Write("Enter word to replace: "); + string oldWord = Console.ReadLine(); + Console.Write("Enter new word: "); + string newWord = Console.ReadLine(); + service.ReplaceWord(oldWord, newWord); + Console.WriteLine("Word replaced."); + break; + + case "8": + Console.Write("Enter start index: "); + int start = int.Parse(Console.ReadLine()); + Console.Write("Enter length: "); + int length = int.Parse(Console.ReadLine()); + + try + { + string result = service.ExtractSubstring(start, length); + Console.WriteLine("Substring: " + result); + } + catch + { + Console.WriteLine("Invalid index or length."); + } + break; + + case "9": + service.TrimSpaces(); + Console.WriteLine("Spaces trimmed."); + break; + + case "10": + service.ResetText(); + Console.WriteLine("Text reset to original."); + break; + + case "11": + isRunning = false; + Console.WriteLine("Exiting program..."); + break; + + default: + Console.WriteLine("Invalid option."); + break; + } + } + } +} From d928aee20e784aeae48669a6a4acd9a7ba8bb71d Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:35:23 +0800 Subject: [PATCH 08/11] Create View --- StringProcessingApp/View | 1 + 1 file changed, 1 insertion(+) create mode 100644 StringProcessingApp/View diff --git a/StringProcessingApp/View b/StringProcessingApp/View new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/StringProcessingApp/View @@ -0,0 +1 @@ + From a8625d2f7dc55ae337ae12644b8d8d7ad10019e1 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:36:12 +0800 Subject: [PATCH 09/11] Delete StringProcessingApp/View --- StringProcessingApp/View | 1 - 1 file changed, 1 deletion(-) delete mode 100644 StringProcessingApp/View diff --git a/StringProcessingApp/View b/StringProcessingApp/View deleted file mode 100644 index 8b13789..0000000 --- a/StringProcessingApp/View +++ /dev/null @@ -1 +0,0 @@ - From 06d8bbbe43228135252067aade436136ddb28d69 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:36:25 +0800 Subject: [PATCH 10/11] Delete StringProcessingApp/Service directory --- StringProcessingApp/Service/StringView.cs | 121 ---------------------- 1 file changed, 121 deletions(-) delete mode 100644 StringProcessingApp/Service/StringView.cs diff --git a/StringProcessingApp/Service/StringView.cs b/StringProcessingApp/Service/StringView.cs deleted file mode 100644 index 32d86bd..0000000 --- a/StringProcessingApp/Service/StringView.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using StringProcessingApp.Services; - -namespace StringProcessingApp.Views -{ - public class StringView - { - private StringService service = new StringService(); - private bool isRunning = true; - - public void Run() - { - while (isRunning) - { - ShowMenu(); - Console.Write("Choose option: "); - string choice = Console.ReadLine(); - - HandleChoice(choice); - } - } - - private void ShowMenu() - { - 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"); - } - - private void HandleChoice(string choice) - { - switch (choice) - { - case "1": - Console.Write("Enter text: "); - string input = Console.ReadLine(); - service.SetText(input); - break; - - case "2": - Console.WriteLine("Current Text: " + service.GetText()); - break; - - case "3": - service.ToUpperCase(); - Console.WriteLine("Converted to UPPERCASE."); - break; - - case "4": - service.ToLowerCase(); - Console.WriteLine("Converted to lowercase."); - break; - - case "5": - Console.WriteLine("Character Count: " + service.CountCharacters()); - break; - - case "6": - Console.Write("Enter word to check: "); - string word = Console.ReadLine(); - bool contains = service.ContainsWord(word); - Console.WriteLine("Contains word? " + contains); - break; - - case "7": - Console.Write("Enter word to replace: "); - string oldWord = Console.ReadLine(); - Console.Write("Enter new word: "); - string newWord = Console.ReadLine(); - service.ReplaceWord(oldWord, newWord); - Console.WriteLine("Word replaced."); - break; - - case "8": - Console.Write("Enter start index: "); - int start = int.Parse(Console.ReadLine()); - Console.Write("Enter length: "); - int length = int.Parse(Console.ReadLine()); - - try - { - string result = service.ExtractSubstring(start, length); - Console.WriteLine("Substring: " + result); - } - catch - { - Console.WriteLine("Invalid index or length."); - } - break; - - case "9": - service.TrimSpaces(); - Console.WriteLine("Spaces trimmed."); - break; - - case "10": - service.ResetText(); - Console.WriteLine("Text reset to original."); - break; - - case "11": - isRunning = false; - Console.WriteLine("Exiting program..."); - break; - - default: - Console.WriteLine("Invalid option."); - break; - } - } - } -} From 09e12a6e55f9dc3156ac8768e1ae8e396ed37f41 Mon Sep 17 00:00:00 2001 From: DayneChristianSingcol Date: Sat, 28 Feb 2026 11:36:52 +0800 Subject: [PATCH 11/11] Implement StringView for user interaction --- StringProcessingApp/View/StringView.cs | 121 +++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 StringProcessingApp/View/StringView.cs diff --git a/StringProcessingApp/View/StringView.cs b/StringProcessingApp/View/StringView.cs new file mode 100644 index 0000000..32d86bd --- /dev/null +++ b/StringProcessingApp/View/StringView.cs @@ -0,0 +1,121 @@ +using System; +using StringProcessingApp.Services; + +namespace StringProcessingApp.Views +{ + public class StringView + { + private StringService service = new StringService(); + private bool isRunning = true; + + public void Run() + { + while (isRunning) + { + ShowMenu(); + Console.Write("Choose option: "); + string choice = Console.ReadLine(); + + HandleChoice(choice); + } + } + + private void ShowMenu() + { + 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"); + } + + private void HandleChoice(string choice) + { + switch (choice) + { + case "1": + Console.Write("Enter text: "); + string input = Console.ReadLine(); + service.SetText(input); + break; + + case "2": + Console.WriteLine("Current Text: " + service.GetText()); + break; + + case "3": + service.ToUpperCase(); + Console.WriteLine("Converted to UPPERCASE."); + break; + + case "4": + service.ToLowerCase(); + Console.WriteLine("Converted to lowercase."); + break; + + case "5": + Console.WriteLine("Character Count: " + service.CountCharacters()); + break; + + case "6": + Console.Write("Enter word to check: "); + string word = Console.ReadLine(); + bool contains = service.ContainsWord(word); + Console.WriteLine("Contains word? " + contains); + break; + + case "7": + Console.Write("Enter word to replace: "); + string oldWord = Console.ReadLine(); + Console.Write("Enter new word: "); + string newWord = Console.ReadLine(); + service.ReplaceWord(oldWord, newWord); + Console.WriteLine("Word replaced."); + break; + + case "8": + Console.Write("Enter start index: "); + int start = int.Parse(Console.ReadLine()); + Console.Write("Enter length: "); + int length = int.Parse(Console.ReadLine()); + + try + { + string result = service.ExtractSubstring(start, length); + Console.WriteLine("Substring: " + result); + } + catch + { + Console.WriteLine("Invalid index or length."); + } + break; + + case "9": + service.TrimSpaces(); + Console.WriteLine("Spaces trimmed."); + break; + + case "10": + service.ResetText(); + Console.WriteLine("Text reset to original."); + break; + + case "11": + isRunning = false; + Console.WriteLine("Exiting program..."); + break; + + default: + Console.WriteLine("Invalid option."); + break; + } + } + } +}