Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Task: To transform this sentence so that the first two words (Close on) are in all caps and the rest is lower case.
- using System;
- namespace MovieScript
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Script line
- string script = "Close on a portrait of the HANDSOME PRINCE -- as the BEAST'S giant paw slashes it.";
- // Get camera directions - using string properties
- int charPosition = script.IndexOf("Close");
- int length = "Close on".Length;
- string cameraDirections = script.Substring(charPosition, length);
- // Get scene description
- charPosition = script.IndexOf("a portrait");
- string sceneDescription = script.Substring(charPosition);
- // Make camera directions uppercase
- cameraDirections = cameraDirections.ToUpper();
- // Make scene description lowercase
- sceneDescription = sceneDescription.ToLower();
- // Print results using interpolation
- Console.WriteLine($"{cameraDirections} {sceneDescription}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement