MB6-704 · Question #61
You need to extract the last three characters from the string value of 122018 by using X++ code. Which two code segments achieve this goal? Each correct answer presents a complete solution.
The correct answer is B. = substr('122018', 4,3) C. = substr('122018', 6,-3). Subst retrieves part of a string. str subStr(str _text, int _position, int _number) The original string. The position in the original string where the part to retrieve begins. A signed integer that indicates the direction and number of positions to retrieve from the original If…
Question
You need to extract the last three characters from the string value of 122018 by using X++ code. Which two code segments achieve this goal? Each correct answer presents a complete solution.
Options
- A= substr('122018', 0,3)
- B= substr('122018', 4,3)
- C= substr('122018', 6,-3)
- D= str2num('122018', 3)
- E= str2num('122018', -3)
How the community answered
(65 responses)- A3% (2)
- B77% (50)
- D8% (5)
- E12% (8)
Explanation
Subst retrieves part of a string. str subStr(str _text, int _position, int _number) The original string. The position in the original string where the part to retrieve begins. A signed integer that indicates the direction and number of positions to retrieve from the original If there is a minus sign preceding _number, the system selects the substring backward from the specified position. Not d, not E: str2Num converts a string to a real number. Syntax: real str2Num(str _text)
Topics
Community Discussion
No community discussion yet for this question.