Explorer

std.ascii-change-case-char

description
The character at the same index of to if character is in from, otherwise character as it is
type
Fn(character: String, from: String, to: String) -> String
expression
fn(character$0, from$1, to$2) =>
  let index$3 = @std.string-index-of(text: $1, target: $0, startIndex: 0);
  match @core.less-than(left: $3, right: 0) {
    true =>
      $0,
    false =>
      @core.string-slice(value: $2, start: $3, end: @core.plus(left: $3, right: 1))
  }
visibility
public
std.ascii-change-case-char (project definy, branch main, snapshot CfIAXM725tR74SWd4aoTUz4-JJQfqnllblZbQ2Sv204)
id: tDrSDxYwbV59dYSwwiKyS6Tqca6iluo2whJhOQYQPuQ
content hash: RHPuYLZySbCLG7JwLD9H4WAgbOn95tmPbhqq107dYoI