Two standard functions strFind and strScan can be used based on business requirement for find a special character from an input string.
Here is an example with both functions;
Both functions return integer value.
StrScan Function
Int found = 0;
Str target= "Dynamics AX 365 operation";
found = strScan(target, "365", 0, strLen(target));
where parameters are;
1. string
2. string
3. position
4. number
StrFind Function
Int found = 0;
Str target= "Dynamics AX 365 operation";
found = strFind(target, "X", 0, strLen(target));
where parameters are;
1. string
2. character
3. position
4. number
Here is an example with both functions;
Both functions return integer value.
StrScan Function
Int found = 0;
Str target= "Dynamics AX 365 operation";
found = strScan(target, "365", 0, strLen(target));
where parameters are;
1. string
2. string
3. position
4. number
StrFind Function
Int found = 0;
Str target= "Dynamics AX 365 operation";
found = strFind(target, "X", 0, strLen(target));
where parameters are;
1. string
2. character
3. position
4. number
For this case strFind and strScan return different results.
ReplyDeleteExample:
str sString = "ABCD EFG";
int nValue;
;
nValue = strFind(sString, "F", 1, strLen(sString)); //returns 6
nValue = strScan(sString, "F", 1, strLen(sString)); //returns - 7
That the difference between these functions.