I have the below condition where values are as below.
```
emp_name="Sid"
emp_id=1234
emp_hobby=""
emp_likes="swimming"
emp_dislikes=""
emp_summary="emp_name:$emp_name,emp_id:$emp_id,emp_hobby:$emp_hobby,emp_likes:$emp_likes,emp_dislikes:$emp_dislikes"
```
if I echo above with the values that are provided as an example it will give result as
`"emp_name:"Sid",emp_id:1234,emp_hobby:,empf_likes:"swimming",emp_dislikes:"`
I need help with a dynamic code where if any of the value is null that complete variable is removed from the echo as below
`"emp_name:"Sid",emp_id:1234,emp_likes:"swimming"`
i tried {parameter:+word} returns the values but not sure how to deal with the variable name itself.
What I have tried:
i tried {parameter:+word} returns the values but not sure how to deal with the variable name itself.