want to convert "indiaChinaFrance" to "India China France"

Certified Senior Developer

want to display dynamic field name on screen but with updating initial as capital and adding one space in between.Field name always start with small caps

eg. "indiaChinaFrance" to "India China France"

eg. abcDefXyz to "Abc Def Xyz"

  Discussion posts and replies are publicly visible

Parents Reply
  • #JobSecurity Laughing

    It is a beautiful piece of code though!  Not sure I even knew the proper() function existed until now..

    Might as well include my solution here also Slight smile

    a!localVariables(
      local!input: "indiaChinaFrance",
      joinarray(
        a!forEach(
          items: enumerate(len(local!input)),
          expression: a!localVariables(
            local!char: charat(local!input,fv!index),
            if(
              fv!isFirst,
              upper(local!char),
              if(
                code(local!char)<97,
                concat(" ",local!char),
                local!char
              )
            )
          )
        )
      )
    )

Children
No Data