Consider the \section{abc}
the output will be like
1. abc
how can I change the '.' to '-' or vice versa. i.e.
2- abc
Consider the \section{abc}
the output will be like
1. abc
how can I change the '.' to '-' or vice versa. i.e.
2- abc
Redefining \thesection doesn't help, because this will give wrong results when referencing a section number.
A “package free” solution is to access the \@seccntformat feature:
\documentclass{article}
\makeatletter
\renewcommand{\@seccntformat}[1]{%
\csname the#1\endcsname\ --\ }
\makeatletter
\begin{document}
\section{Introduction}\label{sec:intro}
We're in section~\ref{sec:intro}.
\end{document}

You can use
\renewcommand{\thesection}{\arabic{section}-}
for that specific purpose. Note that you could also use roman, Roman, alph or Alph instead of arabic, and you can also customize further by adding \thechapter, for instance.
Without an additional knowledge about usage it may be simply (see probably corrected spacing):
\documentclass{article}
\def\thesection{\arabic{section}--\hspace{-1em}}
\begin{document}
\section{First}
\end{document}

\ref{sec:whatever} when the label is linked to a section?
– egreg
Jun 18 '13 at 08:25
articleclass would be\makeatletter\renewcommand\thesection{\@arabic\c@section-}\makeatother... but look at what that does to the Table of Contents (or if you also have subsections). It is therefore best to provide a minimal example (or here). – jon Jun 18 '13 at 05:58