F# Tutorial - Hello World in 5 minutes

Edit your code

Open Program.fs in any text editor and replace all of the code with the following. If you want to, you can replace the name Ana with your name.

Program.fs
// Define a new function to print a name.
let printGreeting name =
    printfn $"Hello {name} from F#!"

// Call your new function!
printGreeting "Ana"

Save the Program.fs file and run your code again.

Command prompt
dotnet run

If your app ran successfully, you should see an output similar to the following:

Command prompt
Hello Ana from F#!
Continue