Cut #3 HackerRank Solution

Hello coders, In this post, you will learn how to solve Cut #3 HackerRank Solution. This problem is a part of the Linux Shell series.

Cut #3 HackerRank Solution
Cut #3 HackerRank Solution

Cut #3 HackerRank Solution

Problem

Display a range of characters starting at the 2nd position of a string and ending at the 7th position (both positions included).

Input Format

A text file containing N lines of ASCII text only.

Constraints

  • 1 <= N <= 100

Output Format

The output should contain N lines.
Each line should contain the range of characters starting at the 2nd position of a string and ending at the 7th position (both positions included).

Sample Input

Hello
World
how are you

Sample Output

ello
orld
ow are

Cut #3 – HackerRank Solution

# Display a range of characters starting at the 2nd position of a string and ending at the 7th position (both positions included)
cut -c 2-7

Note: This problem (Cut #3) is generated by HackerRank but the solution is provided by chase2learn. This tutorial is only for Learning and Educational purpose.

Leave a Comment