Remove the First Capital Letter from Each Element

Sort by

recency

|

178 Discussions

|

  • + 0 comments

    !/bin/bash

    countries=() while IFS= read -r line; do # Replace first uppercase letter with '.' transformed=line" | sed 's/[A-Z]/./') countries+=("$transformed") done

    Print all transformed country names separated by spaces

    echo "${countries[@]}"

  • + 0 comments

    Great challenge on HackerRank! 🐧 Working with arrays in Bash really sharpens your scripting skills, and manipulating strings—like removing the first capital letter from each element—adds an extra layer of complexity. Mahadevbook777 ID

  • + 0 comments

    readarray list echo ${list[@]/[A-Z]/.}

  • + 0 comments

    readarray -t a arr={arr[@]}"

  • + 0 comments

    This function modifies a list by converting the first capital letter of each element to lowercase. It ensures uniform formatting while preserving the rest of the string. Ekbet16