Advertentie

Spatiëringsfout

Een ongewenste spatie is in de tekst ingevoegd.

Leren

Een ongewenste spatie is in de tekst ingevoegd.

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)

Zo herkent u het

  • String contains unexpected space character
  • Length is one character longer
  • Space appears where data should be continuous

Veelgemaakte fouten

  • Overlooking spaces in visual inspection
  • Confusing with intentional formatting
  • Missing spaces at the start or end

Stapsgewijze uitwerking

Vind de fout: Origineel '12345' vs Gegeven '123 45'

  1. Lengtes controleren: origineel heeft 5 tekens, gegeven heeft 6
  2. Positie 1 vergelijken: '1' = '1'
  3. Positie 2 vergelijken: '2' = '2'
  4. Positie 3 vergelijken: '3' = '3'
  5. Positie 4 vergelijken: '4' vs ' ' - spatie gevonden
  6. Een ongewenste spatie is ingevoegd na positie 3
  7. De overige tekens '45' zijn één positie verschoven

Antwoord: Spatiëringsfout: ongewenste spatie ingevoegd tussen '3' en '4' op positie 4

Oefenadvies

Foutcontrole

Advertentie