Hello
Is there a function to replace characters in a string.
I need to remove ":" and the "." in a time string like 06:30:37.957
Martin
Is there a Characters replacement in a string function?
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
Re: Is there a Characters replacement in a string function?
Probably there is a function to do the trick; I haven't came across it yet.Hello
Is there a function to replace characters in a string.
I need to remove ":" and the "." in a time string like 06:30:37.957
Martin
To remove the characters, you have to:
1. find out the length of the string,
2. run a loop to cycle through the length of the string,
3. at each cycle, check to see if the successive character of the string is a ":" or ".",
4. if not, then add the character to the "new" string,
5. if so, then skip the character and go on to the next one.
6. at the end of the loop, you will have the new string without the ":" or "." .
Re: Is there a Characters replacement in a string function?
Martin,
FormatTime("HHmmss",datetime) or
FormatTime("HHmmss",el_timetodatetime_s (time_s)) returns 063037 as string.
FormatTime("hhmmssms", datetime)) returns 063037957 with Milliseconds.
FormatTime("HHmmss",datetime) or
FormatTime("HHmmss",el_timetodatetime_s (time_s)) returns 063037 as string.
FormatTime("hhmmssms", datetime)) returns 063037957 with Milliseconds.