lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I am using the function string.find(string.sub("12 N Y",1,2),slot) in my

Where slot has values 1 to 14. However,when comparing the slot value
with the output of "string.sub"< string.sub("12 N Y",1,2) >,i am getting
the positive response for slot =1,2,12. My requirement is: string.find
function must return TRUE only when slot number is equal to the output
of string.sub function,ie slot=12 and output of string.sub is 12".

Please check the output response of the above scenario :

	slot		string.sub		Response
	----		----------		--------
	  1		   12			   1
	  2 		   12			   2
        3            12			   0
        4		   12			   0

        11           12                0
        12           12                1
        13           12                0
        14           12                0

Is there any alternate way to achieve the same?

Pls throw some pointers on this.

Thanks & Regards,

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.