Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Richard Jones <rich@annexia.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Concatenation of int and String
Date: Fri, 22 Oct 2004 15:24:08 +0100	[thread overview]
Message-ID: <20041022142408.GA31235@annexia.org> (raw)
In-Reply-To: <41793364.5010507@neptun.uni-freiburg.de>

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

On Fri, Oct 22, 2004 at 04:20:52PM +0000, Jan Stamer wrote:
> Hi Folks,
> 
> I am very new to OCaml and I am taking my first steps at the moment...

Welcome.  For beginners questions, you may find the beginners' list
more useful: http://groups.yahoo.com/group/ocaml_beginners

> Can you tell me how to concatenate a int and a String?

There are several ways.  Assuming your int is 'i' and your string is
's', then the following will return a string which is a concatenation
of the two:

  Printf.sprintf "%d%s" i s

  string_of_int i ^ s     (* notice this groups as (string_of_int i) ^ s *)

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
NET::FTPSERVER is a full-featured, secure, configurable, database-backed
FTP server written in Perl: http://www.annexia.org/freeware/netftpserver/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2004-10-22 14:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-22 16:20 Jan Stamer
2004-10-22 14:24 ` Richard Jones [this message]
2004-10-23 20:31 ` Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041022142408.GA31235@annexia.org \
    --to=rich@annexia.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox