05-10-2006 08:42 AM
05-10-2006 08:55 AM - edited 05-10-2006 08:55 AM
You can use the Match Pattern function with [1-9] as the expression. The help for Match Pattern includes many examples on how to use it.
Message Edited by Dennis Knutson on 05-10-2006 07:56 AM
05-10-2006 09:20 AM
05-10-2006 09:43 AM
Anybody wanna see the REALLY ugly solution?
Anyway, experience tells me there's a fair chance that this isn't really what you're after. What's your end goal? LabVIEW has some surprising answers: the trick is in knowing the correct question!!
05-10-2006 09:56 AM
As the help explains:
offset past match is the index in string of the first character of after substring. If the function does not find a match, offset past match is –1. The offset input and the offset past match output might be equal when the empty string is a valid match for the regular expression. For example, if regular expression is b* and the string input is cdb, offset past match is 0. If string is bbbcd, offset past match is 3.
05-10-2006 09:59 AM - edited 05-10-2006 09:59 AM
Message Edited by altenbach on 05-10-2006 08:00 AM
05-10-2006 10:25 AM - edited 05-10-2006 10:25 AM
@altenbach wrote:
Just convert it to an exponential string and take the first character ;).
This only works for positive numbers of course. If the number is negative, grab the second character.
Message Edited by altenbach on 05-10-2006 08:26 AM
05-10-2006 10:58 PM
Hiii, Altenbach
Thanks for the reply.
Actually i made a mistake when i wrote the initial question in the post, i want the position offset of the first nonzero value, can you please do it for me? and with considering if number is negative...
Thanks,
Nishant
05-10-2006 11:04 PM
05-10-2006 11:25 PM
Hiii, Altenbach
Thanks for the prompt reply, simply i use your idea in Dennis's solution and i ve got what i want.
Thanks,
Nishant