File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 21
21
<Compile Include =" Strings/WordOccurrence.fs" />
22
22
<Compile Include =" Strings/RemoveDuplicates.fs" />
23
23
<Compile Include =" Strings/ReverseWords.fs" />
24
+ <Compile Include =" Strings\Upper.fs" />
24
25
<Compile Include =" Program.fs" />
25
26
</ItemGroup >
26
27
</Project >
Original file line number Diff line number Diff line change
1
+ namespace Algorithms.Strings
2
+
3
+ module Upper =
4
+ /// <summary>
5
+ /// Will convert the entire string to uppercase letters
6
+ /// </summary>
7
+ /// <param name="input">String to change to uppercase.</param>
8
+ /// <returns>Uppercased string</returns>
9
+ let upper ( input : string ) =
10
+ let mutable str = " "
11
+ for phrase in input.Split() do
12
+ let mutable word = " "
13
+ for letter in phrase do
14
+ if letter >= 'a' && letter <= 'z'
15
+ then word <- word + ( string) (( char) (( int) letter - 32 ))
16
+ else word <- word + ( string) letter
17
+ str <- str + word + " "
18
+ str
You can’t perform that action at this time.
0 commit comments