문제

Sorry if this is a stupid question but does anyone know of a function which would allow me to enclose a number in quotation marks in Haskell, for example:

function 7777 -> "7777"

function 1234 -> "1234"

Thanks for any help :)

도움이 되었습니까?

해결책

Do you mean, convert 7777 to a string? You can use show.

show 7777 --> "7777"

If you then want quotes around that string do:

"\"" ++ show 7777 ++ "\""
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top