If the reference string (length) is fixed, then there is no need repeating the reference string within the table. More importantly, notice that the result for the entry <space>abc<space> is not what you expected.
\documentclass{article}
\usepackage{xstring}
\usepackage{array,hhline}
\newcommand\fletters[1]{\StrLen{#1}[\templen]\StrGobbleLeft{0000}{\templen}#1}
\def\jline{\\\hhline{*2{|=}|}}
\begin{document}
\begin{tabular}{*2{|>{\centering\arraybackslash}m{3cm}}|}\hline
\textbf{Given} & \textbf{Expected}\jline
\fletters{ abc} & 00ab \\\hline
\fletters{abcde} & \fletters{ab} \\\hline
\fletters{a} & \fletters{ab} \\\hline
\end{tabular}
\end{document}
EDIT
Here is a more robust solution.
\documentclass{article}
\usepackage{catoptions}
\usepackage{array,hhline}
\makeatletter
% \getStringLength[<result.cmd>]{<string>}
% \getStringLength*[<result.cmd>]{<stringcmd>}
% The default of <result.cmd> is \slength.
\robust@def*\getStringLength{\cpt@teststopt\get@StringLength\slength}
\robust@def*\get@StringLength[#1]#2{%
\begingroup
\cpt@stchoose{cpt@st}{#2}\reserved@a\getStringLength
\despacecontent\reserved@a
\@tempcnta\z@pt
\expandafter\cpttfor\reserved@a\dofor{\advance\@tempcnta\@ne}%
\edef\slength{\the\@tempcnta}%
\postgroupdef\slength\endgroup
}
% \stringGobbleLeft[<result.cmd>]{<string>}{<number>}
% \stringGobbleLeft*[<result.cmd>]{<stringcmd>}{<number>}
% The default of <result.cmd> is \rstring.
\robust@def*\stringGobbleLeft{\cpt@teststopt\string@GobbleLeft\rstring}
\robust@def*\string@GobbleLeft[#1]#2#3{%
\begingroup
\cpt@stchoose{cpt@st}{#2}\reserved@a\stringGobbleLeft
\despacecontent\reserved@a
\@tempcnta\z@pt
\def#1{}%
\expandafter\cpttfor\reserved@a\dofor{%
\advance\@tempcnta\@ne
\ifnum\@tempcnta>#3\relax
\edef#1{\expandcsonce#1\unexpanded{##1}}%
\fi
}%
\postgroupdef#1\endgroup
}
% Tests:
\stringGobbleLeft{ 0 0 0 0 }{4}
%\show\rstring % -> empty
% It is possible to take account of unprotected spaces in the string,
% but I am not sure that is what you need.
\stringGobbleLeft{ 0{ }0{ }0 0 }{4}
%\show\rstring % -> 00
\robust@def*\fletters#1{%
\getStringLength{#1}\stringGobbleLeft{0000}\slength
\rstring\cpttrimspace{#1}%
}
\def\jline{\\\hhline{*2{|=}|}}
\makeatother
\begin{document}
\begin{tabular}{*2{|>{\centering\arraybackslash}m{3cm}}|}\hline
\textbf{Given} & \textbf{Expected}\jline
\fletters{ abc } & 00ab \\\hline
\fletters{abcde} & \fletters{ab} \\\hline
\fletters{ a } & \fletters{ab} \\\hline
\end{tabular}
\end{document}