Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Determine string variable type
#2
this should work for you
try this rx
Code:
Copy      Help
if(findrx(s[i] "\D+(?=\d)|\d+(?!.+)|\_(?=\D+)")>=0)
 full code example
Code:
Copy      Help
ARRAY(str) s
s[]="a2" ;;Case 1
s[]="_b" ;;Case 2
s[]="3" ;;Case 3

s[]="2a" ;;Case 4
s[]="C:\Users\Administrator\Desktop\test.txt" ;;Case 5
s[]="C:\Users\Administrator\Desktop" ;;Case 6
s[]="世界" ;;Case 7

for int'i 0 s.len
,if(findrx(s[i] "\D+(?=\d)|\d+(?!.+)|\_(?=\D+)")>=0)
,,out s[i]
,else
,,out F"''{s[i]}''"


Messages In This Thread
Determine string variable type - by macman - 01-12-2021, 01:51 AM
RE: Determine string variable type - by Kevin - 01-12-2021, 04:07 AM
RE: Determine string variable type - by macman - 01-12-2021, 05:29 AM
RE: Determine string variable type - by Kevin - 01-12-2021, 06:10 AM
RE: Determine string variable type - by macman - 01-12-2021, 07:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)