val length : string -> int
Return the length (number of characters) of the given string.
val get : string -> int -> char
String.get s nreturns character numbernin strings. The first character is character number 0. The last character is character numberString.length s - 1. RaiseInvalid_argumentifnis outside the range 0 to(String.length s - 1). You can also writes.[n]instead ofString.get s n.
val set : string -> int -> char -> unit
String.set s n cmodifies stringsin place, replacing the character numbernbyc. RaiseInvalid_argumentifnis outside the range 0 to(String.length s - 1). You can also writes.[n] <- cinstead ofString.set s n c.
val create : int -> string
String.create nreturns a fresh string of lengthn. The string initially contains arbitrary characters. RaiseInvalid_argumentifn <= 0orn > Sys.max_string_length.
val make : int -> char -> string
String.make n creturns a fresh string of lengthn, filled with the characterc. RaiseInvalid_argumentifn <= 0orn > Sys.max_string_length.
val copy : string -> string
Return a copy of the given string.
val sub : string -> int -> int -> string
String.sub s start lenreturns a fresh string of lengthlen, containing the characters numberstarttostart + len - 1of strings. RaiseInvalid_argumentifstartandlendo not designate a valid substring ofs; that is, ifstart < 0, orlen < 0, orstart + len > String.length s.
val fill : string -> int -> int -> char -> unit
String.fill s start len cmodifies stringsin place, replacing the characters numberstarttostart + len - 1byc. RaiseInvalid_argumentifstartandlendo not designate a valid substring ofs.
val blit : string -> int -> string -> int -> int -> unit
String.blit src srcoff dst dstoff lencopieslencharacters from stringsrc, starting at character numbersrcoff, to stringdst, starting at character numberdstoff. It works correctly even ifsrcanddstare the same string, and the source and destination chunks overlap. RaiseInvalid_argumentifsrcoffandlendo not designate a valid substring ofsrc, or ifdstoffandlendo not designate a valid substring ofdst.
val concat : string -> string list -> string
String.concat sep slcatenates the list of stringssl, inserting the separator stringsepbetween each.
val escaped: string -> string
Return a copy of the argument, with special characters represented by escape sequences, following the lexical conventions of Objective Caml.
val index: string -> char -> int
String.index s creturns the position of the leftmost occurrence of charactercin strings. RaiseNot_foundifcdoes not occur ins.
val rindex: string -> char -> int
String.rindex s creturns the position of the rightmost occurrence of charactercin strings. RaiseNot_foundifcdoes not occur ins.
val index_from: string -> int -> char -> int val rindex_from: string -> int -> char -> int
Same asString.indexandString.rindex, but start searching at the character position given as second argument.String.index s cis equivalent toString.index_from s 0 c, andString.rindex s ctoString.rindex_from s (String.length s - 1) c.
val contains : string -> char -> bool
String.contains s ctests if charactercappears in the strings.
val contains_from : string -> int -> char -> bool
String.contains_from s start ctests if charactercappears in the substring ofsstarting fromstartto the end ofs. RaiseInvalid_argumentifstartis not a valid index ofs.
val rcontains_from : string -> int -> char -> bool
String.rcontains_from s stop ctests if charactercappears in the substring ofsstarting from the beginning ofsto indexstop. RaiseInvalid_argumentifstopis not a valid index ofs.
val uppercase: string -> string
Return a copy of the argument, with all lowercase letters translated to uppercase, including accented letters of the ISO Latin-1 (8859-1) character set.
val lowercase: string -> string
Return a copy of the argument, with all uppercase letters translated to lowercase, including accented letters of the ISO Latin-1 (8859-1) character set.
val capitalize: string -> string
Return a copy of the argument, with the first letter set to uppercase.
val uncapitalize: string -> string
Return a copy of the argument, with the first letter set to lowercase.