Time String to integer

 

I have a time string like either :

"22:30"

"01:30"

"00:45"

And I want to turn it into an integer

2230

130

45

Is there an easy way to do this ??

 

string str="22:45";

string str1="";

for(int i=0;i<StringLen(str);i++)

if(StringSubstr(str,i,1)!=":")str1=StringConcatenate(str1,StringSubstr(str,i,1));

int number=StrToInteger(str1);

 
Roger wrote >>

string str="22:45";

string str1="";

for(int i=0;i<StringLen(str);i++)

if(StringSubstr(str,i,1)!=":")str1=StringConcatenate(str1,StringSubstr(str,i,1));

int number=StrToInteger(str1);

Thanks