Opzione 1
This commit is contained in:
parent
0c0dba09f5
commit
9a6a7d033d
24
Program.cs
24
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;
|
||||
}
|
||||
}
|
||||
|
||||
BIN
bin/Debug/net9.0/strings_1
Executable file
BIN
bin/Debug/net9.0/strings_1
Executable file
Binary file not shown.
23
bin/Debug/net9.0/strings_1.deps.json
Normal file
23
bin/Debug/net9.0/strings_1.deps.json
Normal file
@ -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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
bin/Debug/net9.0/strings_1.dll
Normal file
BIN
bin/Debug/net9.0/strings_1.dll
Normal file
Binary file not shown.
BIN
bin/Debug/net9.0/strings_1.pdb
Normal file
BIN
bin/Debug/net9.0/strings_1.pdb
Normal file
Binary file not shown.
12
bin/Debug/net9.0/strings_1.runtimeconfig.json
Normal file
12
bin/Debug/net9.0/strings_1.runtimeconfig.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net9.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "9.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
obj/Debug/net9.0/apphost
Executable file
BIN
obj/Debug/net9.0/apphost
Executable file
Binary file not shown.
BIN
obj/Debug/net9.0/ref/strings_1.dll
Normal file
BIN
obj/Debug/net9.0/ref/strings_1.dll
Normal file
Binary file not shown.
BIN
obj/Debug/net9.0/refint/strings_1.dll
Normal file
BIN
obj/Debug/net9.0/refint/strings_1.dll
Normal file
Binary file not shown.
@ -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.
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
ee7f9dfff348a2f12e1a614efb59dd81290f3a39a048bfa56c88f777e98adb6e
|
||||
04a8bffd0985b606c02f47e14af099392fb8a67f7a6b726a8ce22dfe96827131
|
||||
|
||||
@ -0,0 +1 @@
|
||||
fb927268c7b1060217e4f7ad3a11ad8f810e3d610cb172113baec1dadeb516cb
|
||||
14
obj/Debug/net9.0/strings_1.csproj.FileListAbsolute.txt
Normal file
14
obj/Debug/net9.0/strings_1.csproj.FileListAbsolute.txt
Normal file
@ -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
|
||||
BIN
obj/Debug/net9.0/strings_1.dll
Normal file
BIN
obj/Debug/net9.0/strings_1.dll
Normal file
Binary file not shown.
1
obj/Debug/net9.0/strings_1.genruntimeconfig.cache
Normal file
1
obj/Debug/net9.0/strings_1.genruntimeconfig.cache
Normal file
@ -0,0 +1 @@
|
||||
4ef0b4131b6d21f6f805d392a8983e9dd147fcb78ed55fd4d1215a826971cbb0
|
||||
BIN
obj/Debug/net9.0/strings_1.pdb
Normal file
BIN
obj/Debug/net9.0/strings_1.pdb
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user