Share your content and reach out to more developers by submitting them at Abundantcode.com - Developer Community Site

Category: F#

F# Program to display "Hello, World!"

Problem Write a program in F# to display "Hello, World!" on the screen. F# Program to display "Hello, World!" in Console Window. This is a simple F# program that displays "Hello, World!" on the console window. // Program to display Hello,World! by Abundantcode.com [<EntryPoint>] let main argv = printfn "Hello, World!" 0 // return an integer exit code Output Hello, World! Tutorials you might find…

FSharp Interactive Commands

FSharp Interactive UI includes few good number of commands which can be used by the F# Developers . Below are some of the FSI Commands which can be used by the developers. FSharp Interactive Commands Cancel Interactive Evaluation – This option cancels the execution of the FSI . Reset Interactive Session – This option resets the execution of the current FSI . Cut – This…

#time switch to measure the execution time in F#

If you want to measure the execution time of your F# code , you can use the #time attribute which lets you measure the F# code easily. > #time “on”;; –> let a = 1 > #time “off”;; Tutorials you might find interesting:C Program to find the simple and compound interestSenthil-Kumar-B-Posted-by-Senthil-Kumar-B-August-12-2020-CSharp-3-Min-Read-Microsoft-had-released-the-preview-version-of-.NET-5-some-time-back-which-comes-with-C-9-Preview-too.-While-it-is-sti…REVIEW – Recover Excel Password with password-find OnlineQuick Tip —CSS Containment Module by @[email protected]_vault

Match Statement in F#

Match Statement is similar to switch statement in C# . Below is a sample code snippet demonstrating the use of Match statement in F#. Match Statement in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = let value1 = 10 match value1 with | 5 -> Console.WriteLine(“Value is 5”) | 10 -> Console.WriteLine(“Value is 10”) | _ -> Console.WriteLine(“Default…

Example of If Conditional Statement in F#

Example of If Conditional Statement in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = let value1 = 10 let value2 = 25 if value1 > value2 then Console.WriteLine(“Value 1 is greater”) elif value1 < value2 then Console.WriteLine(“Value 2 is greater”) let retval = Console.ReadLine() 0 // return an integer exit code Tutorials you might find interesting:C program to…

While Loop Example in F#

While Loop Example in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = let mutable indexer = 10 while indexer <=50 do Console.WriteLine(indexer) indexer <- indexer + 1 let retval = Console.ReadLine() 0 // return an integer exit code Tutorials you might find interesting:Exit PageC Program to copy the content of file to anotherC Program to a print pascal…

Different Types of For Loops in F#

F# supports 3 different types of For Loops . These include For…to – This is  astandard for loop For .. In – This is similar to For Each in C# for…downto Different Types of For Loops in F# Below is a code snippet demonstrating the different For Loops in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = //…

Declaring a Variable using Keyword in F#

Declaring a Variable using Keyword in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = // Declaring a Variable using Keyword let “let“ = 100 Console.WriteLine(“let“) let retval = Console.ReadLine() 0 // return an integer exit code Tutorials you might find interesting:Exit PageC Program to copy the content of file to anotherC Program to a print pascal triangleSenthil-Kumar-B-Posted-by-Senthil-Kumar-B-August-12-2020-CSharp-3-Min-Read-Microsoft-had-released-the-preview-version-of-.NET-5-some-time-back-which-comes-with-C-9-Preview-too.-While-it-is-sti…C Program…

Declaring a Variable Name with Space in F#

Declaring a Variable Name with Space in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = let “Variable F#“ = 100 Console.WriteLine(“Variable F#“) let retval = Console.ReadLine() 0 // return an integer exit code Tutorials you might find interesting:Exit PageC Program to copy the content of file to anotherC Program to a print pascal triangleSenthil-Kumar-B-Posted-by-Senthil-Kumar-B-August-12-2020-CSharp-3-Min-Read-Microsoft-had-released-the-preview-version-of-.NET-5-some-time-back-which-comes-with-C-9-Preview-too.-While-it-is-sti…C Program to convert uppercase…

Types of Strings in F# Triple Quoted , Verbatim , Normal

There are 3 different types of Strings available in F# Types of Strings in F# 1. Normal String 2. Verbatim String @ 3. Triple Quoted String Below is a sample code demonstrating these 3 different types of strings in F# // AbundantCode F# Tutorials and Code snippets open System [<EntryPoint>] let main argv = // Normal String example let string1 =”Windows Phone Tutorials with Abundantcode.com”…