Module JavaString

module JavaString: sig .. end
Utility functions for Java strings.


Conversion from/to OCaml strings

val of_string : string -> java'lang'String java_instance
of_string s converts the OCaml string s into a Java string.
val to_string : java'lang'String java_instance -> string
to_string s converts the Java string s into an OCaml string.

Raises Java_exeption if s is null.


Null value

val null : java'lang'String java_instance
The null value.
val is_null : java'lang'String java_instance -> bool
is_null x returns true iff x is equal to null.
val is_not_null : java'lang'String java_instance -> bool
is_not_null x returns false iff x is equal to null.

Output functions

val print_string : java'lang'String java_instance -> unit
print_string s prints s onto the standard ouput.
val print_endline : java'lang'String java_instance -> unit
print_endline s prints s followed by a newline character onto the standard ouput.
val prerr_string : java'lang'String java_instance -> unit
prerr_string s prints s onto the error ouput.
val prerr_endline : java'lang'String java_instance -> unit
prerr_endline s prints s followed by a newline character onto the error ouput.
val output_string : Pervasives.out_channel -> java'lang'String java_instance -> unit
output_string ch s prints s onto channel ch.

Input functions

val read_line : unit -> java'lang'String java_instance
read_line () reads a line from the standard input. Returns null when end of input is reached.
val input_line : Pervasives.in_channel -> java'lang'String java_instance
input_line ch reads a line from channel ch. Returns null when end of input is reached.

Miscellaneous

val wrap : java'lang'String java_instance -> java'lang'String java_instance option
wrap x wraps the reference x into an option type: