using System.Globalization;
public static void Main()
string hrlyRate = "$$$ #,20-.0?*4%5 $$ 09";
var num = GetCompRate(hrlyRate);
float? GetCompRate(string hrlyRate)
if (string.IsNullOrEmpty(rate)) return null;
Console.WriteLine($"\r\nstring as it comes in from sending service. Change the var to test different junk string inputs and check how they process. Currently looks like this: \r\n {rate}");
var num = float.TryParse(rate, NumberStyles.Any, CultureInfo.CreateSpecificCulture("en-US"), out var tmp)
Console.WriteLine($"\r\nafter float.TryParse with stacked NumberStyles and Culture specified \r\n {num}");