In our paper, the text formatted text created with formula
\newcommand\functionname[1]{\textbf{\texttt{#1}}}
does not go the new line and goes out of margin when it is at the end of the line. In the middle or start of the line, no problem occurs. The picture below demonstrates the problem.
This is not the same problem as the hyphenation problem. I clearly do not want to edit every text by implicitly adding hyphens that I am using command. That's why I am using a command to format those texts. I just want to know how I can overcome this problem without me adding hyphens or doing similar edits on the words but just through the commands ?
Can you please help me to understand and solve the problem? Kind Regards, Ferda

\functionname{with\-draw\-Invest\-ment}or set the paragraph using\sloppy– David Carlisle Nov 28 '22 at 00:00withdrawInvestmentis not real Eglish so not wll matched by hyphen rules even if you allow hyphenation in tt but there are some answers about hyphenating camel case I will find a link – David Carlisle Nov 28 '22 at 12:59