Remove the First Capital Letter from Each Element

Sort by

recency

|

167 Discussions

|

  • + 0 comments

    !/bin/bash

    replace_char_at_position() { local cadena="2" local nuevo_caracter="{cadena:0:posicion}{cadena:((posicion + 1))} " } count=() aux=() while read n do count+=({count[@]}; do replace_char_at_position {aux[@]}"

  • + 0 comments

    !/bin/bash

    Declare an array to hold the country names

    countries=()

    Read countries from input (one per line)

    while IFS= read -r line; do countries+=("$line") done

    Initialize an array for transformed names

    transformed=()

    Loop through each country name in the array

    for country in "You can't use 'macro parameter character #' in math mode{country/[A-Z]/.}" transformed+=("$transformed_name") done

    Join the transformed names with a space and print the result

    echo "${transformed[*]}"

  • + 0 comments

    Very easy first replacement then adding seperator and put in one line:

    sed "s/([A-Z])/./1" | paste -s -d " "

  • + 0 comments

    awk ' BEGIN { ORS=" " } { gsub(/^[A-Z]/, "."); print } ' this was working

  • + 0 comments

    xargs echo > tmp.txt filecontent=( cat "tmp.txt") pattern=({pattern[@]}