mirror of
				https://github.com/johnwhitington/cpdf-source.git
				synced 2025-06-05 22:09:39 +02:00 
			
		
		
		
	string_trim replaces String.trim for OCaml < 4.00
This commit is contained in:
		
							
								
								
									
										8
									
								
								cpdf.ml
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								cpdf.ml
									
									
									
									
									
								
							@@ -2889,8 +2889,14 @@ let dc = "http://purl.org/dc/elements/1.1/"
 | 
			
		||||
 | 
			
		||||
let rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 | 
			
		||||
 | 
			
		||||
(* For OCaml < 4.00 *)
 | 
			
		||||
let string_trim s =
 | 
			
		||||
  implode
 | 
			
		||||
    (dropwhile
 | 
			
		||||
       Pdf.is_whitespace (rev (dropwhile Pdf.is_whitespace (explode s))))
 | 
			
		||||
 | 
			
		||||
let combine_with_spaces strs =
 | 
			
		||||
  String.trim
 | 
			
		||||
  string_trim
 | 
			
		||||
    (fold_left (fun x y -> x ^ (if x <> "" then ", " else "") ^ y) "" strs)
 | 
			
		||||
 | 
			
		||||
(* Collect all <li> elements inside a seq, bag, or alt. Combine with commas. If
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								cpdfmanual.pdf
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								cpdfmanual.pdf
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user