Difference between revisions of "Cum se extrage un substring"

From HaskellWiki
Jump to: navigation, search
(Created page with "Ori cautati o functie din biblioteca ori scrieti dvs una: <haskell> substring :: Int -> Int -> String -> String substring start end text = take (end - start) (drop start text...")
 
Line 6: Line 6:
 
</haskell>
 
</haskell>
   
*Main Data.Text> substring 2 6 "alfaville"
+
Main Data.Text> substring 2 6 "alfaville"
 
"favi"
 
"favi"
*Main Data.Text>
+
Main Data.Text>

Revision as of 12:48, 9 October 2019

Ori cautati o functie din biblioteca ori scrieti dvs una:

substring :: Int -> Int -> String -> String
substring start end text = take (end - start) (drop start text)

Main Data.Text> substring 2 6 "alfaville" "favi" Main Data.Text>