Need help with a Basic Remove function

I have a Variable named “v_Date” that consists of “LogFor07/09/201909:26.txt”. I want to use this for a Dynamic Log File name so I have them Time/Date Stamped. In order to do this I need to remove both “/” and “:” characters. For some reason it will not let me use v_Date = V_Date.toString.Remove(“/”) to remove the “/”

Can someone please tell me what I am doing wrong? Any help would be greatly appreciated

1 Like

how the value of v_Date is created buddy
Cheers @rmiller723

Remove isn’t quite what you want, replace will work better: .Replace(“/”, “”)

Remove uses index tro remove charaters, replace will identify each character or string you want to replace and then use another string you provide to replace it, so to remove rejust give it an empty string: “”

3 Likes

What error are you getting? And instead of remove you can use Replace(“/”,“”)

Thank you, This was a silly mistake on my part, the .Replace(“/”,“”) works great.

1 Like

I use an Assign Function
v_Date = “Log For Date_Time_”+Today.ToShortDateString+Now.ToShortTimeString +“.txt”

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.