Courseiva

UiPath-ADPv1 Advanced Data Manipulation Practice Question

A workflow receives a full customer name as a single string variable, for example 'Ada Lovelace', and must populate separate FirstName and LastName variables. The names always contain exactly one space separating the two parts, and surrounding whitespace may be present. Which expression correctly extracts the two parts?

⚠ Common exam trap

The trap here is using the index of the space as the start of the last name, which leaves a leading space that quietly corrupts later comparisons.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

fullName.Split(" "c)(0) for the first name and fullName.Split(" "c)(1) for the last name, after trimming the input first.

Given a single separating space and possible surrounding whitespace, trimming first and then splitting on the space character yields an array with the first name at index zero and the last name at index one. Indexing those elements populates the two variables correctly. Substring variants mishandle the delimiter or assume equal lengths, and assigning the raw array is a type error.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    fullName.Trim().Replace(" ", "") split into equal halves using the string length divided by two.

    Why it's wrong here

    Removing the space and splitting the remaining characters into two equal halves assumes the first and last names are the same length, which is generally false. For 'AdaLovelace' the halves would not correspond to the real name boundaries, producing garbage values. This destroys the very delimiter that identifies where the first name ends, so it cannot reliably populate FirstName and LastName for arbitrary names and is therefore incorrect.

  • ✗

    fullName.Trim().Split(" "c) assigned directly to the FirstName and LastName variables as an array.

    Why it's wrong here

    Split returns a String array, not two separate scalar values, so assigning the array directly to two String variables is a type mismatch that fails at runtime or compile time. The array must be indexed to reach individual elements. While splitting on the space is the right idea, omitting the indices means the variables never receive the intended first and last name values, so this option does not accomplish the extraction.

  • ✗

    fullName.Substring(0, fullName.IndexOf(" ")) for the first name and fullName.Substring(fullName.IndexOf(" ")) for the last name.

    Why it's wrong here

    Substring with the index of the space excludes the space for the first name, which is correct, but the second call starts at the space itself, so the last name would begin with a leading space character. Without trimming that result, comparisons and downstream lookups fail. Additionally, this approach is fragile if surrounding whitespace shifts the space index. It nearly works but produces a subtly malformed last name, so it is not the correct expression here.

  • ✓

    fullName.Split(" "c)(0) for the first name and fullName.Split(" "c)(1) for the last name, after trimming the input first.

    Why this is correct

    Trimming removes any leading or trailing spaces, then splitting on the space character yields an array whose first element is the first name and second element is the last name, given the guaranteed single separating space. Indexing element zero and element one returns exactly the two parts. This uses standard String.Split semantics and is the straightforward, correct extraction for the stated input format.

About these practice questions

One of 276 original UiPath-ADPv1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official UiPath exam blueprint

This UiPath-ADPv1 practice question is part of Courseiva's free UiPath certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the UiPath-ADPv1 exam.