You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3899 Reporter: philippe_wang Status: closed (set by @damiendoligez on 2005-12-15T12:59:35Z) Resolution: not fixable Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general)
Bug description
I wish I could return a substring (like String.sub but) without copy.
It would allow to do something like :
let s = "hello world" ;;
val s : string = "hello world"
let sub = String.sub_without_copy s 0 5 ;;
val sub : string = "hello"
s.[0] <- 'H' ; s.[1] <- 'E' ; s.[2] <- 'L' ;;
: unit = ()
sub ;;
val sub : string = "HELlo"
s ;;
val s : string = "HELlo world"
(it is very unpleasant to deal with a record type to handle such a feature...)
Additional information
val sub : string -> int -> int -> string
String.sub s start len returns a fresh string of length len , contain-
ing the characters number start to start + len - 1 of string s Raise
Invalid_argument if start and len do not designate a valid substring of
s ; that is, if start < 0 , or len < 0 , or start + len > String.length
s
The text was updated successfully, but these errors were encountered:
Original bug ID: 3899
Reporter: philippe_wang
Status: closed (set by @damiendoligez on 2005-12-15T12:59:35Z)
Resolution: not fixable
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Bug description
I wish I could return a substring (like String.sub but) without copy.
It would allow to do something like :
let s = "hello world" ;;
val s : string = "hello world"
let sub = String.sub_without_copy s 0 5 ;;
val sub : string = "hello"
s.[0] <- 'H' ; s.[1] <- 'E' ; s.[2] <- 'L' ;;
sub ;;
val sub : string = "HELlo"
s ;;
val s : string = "HELlo world"
(it is very unpleasant to deal with a record type to handle such a feature...)
Additional information
val sub : string -> int -> int -> string
The text was updated successfully, but these errors were encountered: