How To Check Length of String After a Certain Character

Hello,

I am trying to find a way to check the length of a string after a certain character.

Example:

I want to find the length of the string after the decimal point.

“123.45”

Length = 2

InputStr.split("."c)(1).length

Before I use the split on the character do I need to check if the character exists in the string?

What will be the output if the character is not present?

Never mind I was able to figure it out.

Thank you!

grafik
and if we put inputStr.LastIndexOf(“.”) on variable e.g. lidx we can shorten to:
IF(lidx > -1,inputStr.Length - lidx - 1,0)

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