I want to extract the first word of a variable from a string. For example, take this input: The resultant output should be Test, which is the first word of the input. How can I do this? Answer You can use the explode function as follows: Another example: