Hi,
I am trying to find the first occurrence of a letter in a certain string.
FIRSTLETTEROCCURRENCE := STRPOS(STRING,'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
However this is looking for that long string and not the letters individually.
Is there any way to use the STRPOS function to look for any occurrence of any letter?
Thanks.
0
Comments
Try This,
FIRSTLETTEROCCURRENCE := STRPOS('ABCDEFGHIJKLMNOPQRSTUVWXYZ','F');
It Will Gives U 6, That is the First Occurance of Character 'F'.
Thanks & Regards,
Purvesh Maisuria.
Regular Expressions in NAV
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
I Go thru ur solution, its working fine, thanks for focusing on new solution. But its working for fix length of CONVERTSTR's 2nd & 3rd Argument, if 2nd and 3rd Args length is differ than it is not working, so developer must have to write code for put same length of '-' as 2nd Argument of CONVERTSTR's Function. But Good to know new technique.
Thanks & Regards,
Purvesh Maisuria.
Or am I missing something :?:
String := '01234ADEFESDFG5KASDF6789';
TempString := CONVERTSTR(String, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', '
');
FirstLetterOccurence := strpos(TempString, '-');
Worked perfectly. Thank you!!! \:D/