FAQ: Working with Text - Get Parts of Strings

I got stuck on Did you define an int named length ? on the second Instructions of C# Get Parts of Strings exercise even i input my code correctly!! what could i go wrong ?

Yeah I’m going to have to chime in with the others saying the instructions in this lesson are awful.

I don’t understand how I’m meant to find out if the char is equal to the letter it wants if I can’ use the EQUAL TO operator.

1 Like

My reply is pending review so I clicked view solution and it turns out the instructions ask a question for literally no reason and it just confuses you. It asks “Show your result in the console. Has there been a mutation?”, so I obviously assumed I’m supposed to show my result and answer the question in the console. Instead it just wants you to show what letter it is and that’s it. I don’t think I’m going to bother with this course any more, all it’s doing is frustrating the ■■■■ out of me.

1 Like

Did you find the solution to this exercise?

You have stopPoint instead of length. It’s asking for the length variable which you did not make. Should be int length = tga + 3;

I think they’re overcomplicating what its asking. As the course did not touch on if statements yet, they shouldn’t be used. It’s asking you to view the output yourself and see IF there is a mutation or not. Just simply print the index and it should let you through.

  // define final strand
  string dna = startStrand.Substring(startPoint, length);


  // DNA mutation search
  Console.WriteLine(dna[3]);

No if statements required. I had a bit of issue at first using dna[length -1] cause of the example but realized it legit just wanted me to grab the index “dna[3]” and look at the output and see if there is a mutation or not.

But I do agree that the directions are somewhat misleading near the end.