tail of string = 104, bit?

View: New views
4 Messages — Rating Filter:   Alert me  

tail of string = 104, bit?

by defn noob :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

when i do tl("hej") I get 104, well I need "h".
How do I get h amd if not possible how do i convert 104 to string?  or how do i convert string to the other format? is it a bit?


Låna pengar utan säkerhet..
Sök och jämför lån hos Kelkoo.
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions

Re: tail of string = 104, bit?

by Lev Walkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Circular Function wrote:
>   when i do tl("hej") I get 104, well I need "h".

104 is a code for 'h'. Try this way

        [tl("hej")].

You'll get a list of one element, which is an "h" letter.

> How do I get h amd if not possible how do i convert 104 to string?  or
> how do i convert string to the other format? is it a bit?


Also, could you please stop using this erlang-question list
as a substitute for an introductory Erlang reading.


--
vlm
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions

Re: tail of string = 104, bit?

by David King-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> when i do tl("hej") I get 104, well I need "h".
> How do I get h amd if not possible how do i convert 104 to string?  
> or how do i convert string to the other format? is it a bit?

A string is a list of integers. [104] =:= "h"
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions

Re: tail of string = 104, bit?

by Jos Visser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I guess you mean hd("hej") returning 103. tl("hej") returns "ej".

In Erlang a string is a list of integers. To make a string from an
integer, just make a list out of it:

f(S) -> [hd(S)].

++Jos.ch

On Wed, Jul 23, 2008 at 06:51:03PM +0000 it came to pass that Circular Function wrote:

> when i do tl("hej") I get 104, well I need "h".
> How do I get h amd if not possible how do i convert 104 to string?  or how do i convert string to the other format? is it a bit?
>
>
>
>       __________________________________________________________
> Låna pengar utan säkerhet. Jämför vilkor online hos Kelkoo.
> http://www.kelkoo.se/c-100390123-lan-utan-sakerhet.html?partnerId=96915014
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@...
> http://www.erlang.org/mailman/listinfo/erlang-questions

--
What cannot be shunned must be embraced. That is the Path...
_______________________________________________
erlang-questions mailing list
erlang-questions@...
http://www.erlang.org/mailman/listinfo/erlang-questions