diff --git a/Program.cs b/Program.cs index 424d7fa..3c641c9 100644 --- a/Program.cs +++ b/Program.cs @@ -19,7 +19,7 @@ class Program { break; case 1: Console.Clear(); - + Console.WriteLine(TrovaESostituisci()); Pausa(); break; case 2: @@ -46,9 +46,29 @@ class Program { while (scelta != 0); } - static void Pausa(){ + static void Pausa() { Console.WriteLine("Premere un tasto per continuare. . ."); Console.ReadKey(); Console.Clear(); } + + static string TrovaESostituisci() { + string daEsserCercato, trova, sostituisci, ritorno; + //Richiedo all'utente il testo in cui cercare, il testo da trovare e il testo con cui sostituire il testo trovato + Console.Write("Inserire il testo in cui cercare: "); + daEsserCercato = Console.ReadLine(); + Console.Write("Inserire il testo da cercare: "); + trova = Console.ReadLine(); + Console.Write("Inserire il testo da sostituire: "); + sostituisci = Console.ReadLine(); + + if (daEsserCercato.Contains(trova)) { + ritorno = daEsserCercato.Replace(trova, sostituisci); + } + else{ + ritorno = $"Nessuna occorrenza di {trova} trovata in {daEsserCercato}"; + } + + return ritorno; + } } diff --git a/bin/Debug/net9.0/strings_1 b/bin/Debug/net9.0/strings_1 new file mode 100755 index 0000000..d716707 Binary files /dev/null and b/bin/Debug/net9.0/strings_1 differ diff --git a/bin/Debug/net9.0/strings_1.deps.json b/bin/Debug/net9.0/strings_1.deps.json new file mode 100644 index 0000000..a509d07 --- /dev/null +++ b/bin/Debug/net9.0/strings_1.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v9.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v9.0": { + "strings_1/1.0.0": { + "runtime": { + "strings_1.dll": {} + } + } + } + }, + "libraries": { + "strings_1/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/bin/Debug/net9.0/strings_1.dll b/bin/Debug/net9.0/strings_1.dll new file mode 100644 index 0000000..b545acf Binary files /dev/null and b/bin/Debug/net9.0/strings_1.dll differ diff --git a/bin/Debug/net9.0/strings_1.pdb b/bin/Debug/net9.0/strings_1.pdb new file mode 100644 index 0000000..ea7a123 Binary files /dev/null and b/bin/Debug/net9.0/strings_1.pdb differ diff --git a/bin/Debug/net9.0/strings_1.runtimeconfig.json b/bin/Debug/net9.0/strings_1.runtimeconfig.json new file mode 100644 index 0000000..b19c3c8 --- /dev/null +++ b/bin/Debug/net9.0/strings_1.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net9.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "9.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/obj/Debug/net9.0/apphost b/obj/Debug/net9.0/apphost new file mode 100755 index 0000000..d716707 Binary files /dev/null and b/obj/Debug/net9.0/apphost differ diff --git a/obj/Debug/net9.0/ref/strings_1.dll b/obj/Debug/net9.0/ref/strings_1.dll new file mode 100644 index 0000000..719cf54 Binary files /dev/null and b/obj/Debug/net9.0/ref/strings_1.dll differ diff --git a/obj/Debug/net9.0/refint/strings_1.dll b/obj/Debug/net9.0/refint/strings_1.dll new file mode 100644 index 0000000..719cf54 Binary files /dev/null and b/obj/Debug/net9.0/refint/strings_1.dll differ diff --git a/obj/Debug/net9.0/strings_1.AssemblyInfo.cs b/obj/Debug/net9.0/strings_1.AssemblyInfo.cs index ceb7bb8..998e8c8 100644 --- a/obj/Debug/net9.0/strings_1.AssemblyInfo.cs +++ b/obj/Debug/net9.0/strings_1.AssemblyInfo.cs @@ -13,10 +13,10 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("strings_1")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+14ddf1dae3db729089bc25cbbbb7788a5f57dd92")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+0c0dba09f56a880aa213506f9e689c9f02f72bc4")] [assembly: System.Reflection.AssemblyProductAttribute("strings_1")] [assembly: System.Reflection.AssemblyTitleAttribute("strings_1")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] -// Generated by the MSBuild WriteCodeFragment class. +// Generato dalla classe WriteCodeFragment di MSBuild. diff --git a/obj/Debug/net9.0/strings_1.AssemblyInfoInputs.cache b/obj/Debug/net9.0/strings_1.AssemblyInfoInputs.cache index 00b8f29..56977f2 100644 --- a/obj/Debug/net9.0/strings_1.AssemblyInfoInputs.cache +++ b/obj/Debug/net9.0/strings_1.AssemblyInfoInputs.cache @@ -1 +1 @@ -ee7f9dfff348a2f12e1a614efb59dd81290f3a39a048bfa56c88f777e98adb6e +04a8bffd0985b606c02f47e14af099392fb8a67f7a6b726a8ce22dfe96827131 diff --git a/obj/Debug/net9.0/strings_1.csproj.CoreCompileInputs.cache b/obj/Debug/net9.0/strings_1.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..7bdce7c --- /dev/null +++ b/obj/Debug/net9.0/strings_1.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +fb927268c7b1060217e4f7ad3a11ad8f810e3d610cb172113baec1dadeb516cb diff --git a/obj/Debug/net9.0/strings_1.csproj.FileListAbsolute.txt b/obj/Debug/net9.0/strings_1.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..ed4028f --- /dev/null +++ b/obj/Debug/net9.0/strings_1.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/home/Verde/git/strings_1/bin/Debug/net9.0/strings_1 +/home/Verde/git/strings_1/bin/Debug/net9.0/strings_1.deps.json +/home/Verde/git/strings_1/bin/Debug/net9.0/strings_1.runtimeconfig.json +/home/Verde/git/strings_1/bin/Debug/net9.0/strings_1.dll +/home/Verde/git/strings_1/bin/Debug/net9.0/strings_1.pdb +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.GeneratedMSBuildEditorConfig.editorconfig +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.AssemblyInfoInputs.cache +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.AssemblyInfo.cs +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.csproj.CoreCompileInputs.cache +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.dll +/home/Verde/git/strings_1/obj/Debug/net9.0/refint/strings_1.dll +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.pdb +/home/Verde/git/strings_1/obj/Debug/net9.0/strings_1.genruntimeconfig.cache +/home/Verde/git/strings_1/obj/Debug/net9.0/ref/strings_1.dll diff --git a/obj/Debug/net9.0/strings_1.dll b/obj/Debug/net9.0/strings_1.dll new file mode 100644 index 0000000..b545acf Binary files /dev/null and b/obj/Debug/net9.0/strings_1.dll differ diff --git a/obj/Debug/net9.0/strings_1.genruntimeconfig.cache b/obj/Debug/net9.0/strings_1.genruntimeconfig.cache new file mode 100644 index 0000000..b4258ec --- /dev/null +++ b/obj/Debug/net9.0/strings_1.genruntimeconfig.cache @@ -0,0 +1 @@ +4ef0b4131b6d21f6f805d392a8983e9dd147fcb78ed55fd4d1215a826971cbb0 diff --git a/obj/Debug/net9.0/strings_1.pdb b/obj/Debug/net9.0/strings_1.pdb new file mode 100644 index 0000000..ea7a123 Binary files /dev/null and b/obj/Debug/net9.0/strings_1.pdb differ