Learn
An unwanted space is inserted into the string.
Spacing errors occur when the spacebar is accidentally pressed during data entry, inserting an unwanted space character. This is common when typing quickly or when hands drift on the keyboard. The resulting string is one character longer with a space where none should exist.
Space inserted at position N: ABCD → AB CD
- 12345 → 123 45 (space inserted)
- HELLO → HEL LO (space in middle)
- AB-1234 → AB- 1234 (space after hyphen)
How to recognize it
- String contains unexpected space character
- Length is one character longer
- Space appears where data should be continuous
Common mistakes
- Overlooking spaces in visual inspection
- Confusing with intentional formatting
- Missing spaces at the start or end
Step-by-step walkthrough
Find the error: Original '12345' vs Given '123 45'
- Check lengths: original has 5 characters, given has 6
- Compare position 1: '1' = '1'
- Compare position 2: '2' = '2'
- Compare position 3: '3' = '3'
- Compare position 4: '4' vs ' ' - space found
- An unwanted space was inserted after position 3
- The remaining characters '45' are shifted by one position
Answer: Spacing error: unwanted space inserted between '3' and '4' at position 4