Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
ion
ion
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 94
    • Issues 94
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • redox-os
  • ionion
  • Issues
  • #441

Closed
Open
Opened Jul 20, 2017 by Michael Aaron Murphy@mmstickMaintainer26 of 33 tasks completed26/33 tasks

List of Methods in Ion

String Methods

String methods return strings

  • $len(string) -> n string
  • $len(array) -> n string (@mmstick)
  • $len_bytes(string) -> n string
  • $join(array) -> string
  • $find(string, string) -> n string
  • $starts_with(string, string) -> 0/1 string (@mmstick)
  • $ends_with(string, string) -> 0/1 string (@mmstick)
  • $contains(string, string) -> 0/1 string (@mmstick)
  • $replace(string, string) -> string (@mmstick)
  • $replacen(string, string) -> string (@mmstick)
  • $to_lowercase(string) -> string (@pithonsmear)
  • $to_uppercase(string) -> string (@pithonsmear)
  • $repeat(string, n) -> string (@mmstick)
  • $extension(filepath) -> string (@pithonsmear)
  • $basename(filepath) -> string (@pithonsmear)
  • $parent(filepath) -> string (@pithonsmear)
  • $filename(filepath) -> string (@pithonsmear)
  • $or(string, expr) -> string
    • If the given string does not exist, use the given expression
  • $reverse(string) -> string (@pithonsmear)
  • $fold(array, string) -> string
    • Apply a reduce/fold function to an array
    • The supplied string should name a command to apply to the array
  • $open(string) -> string
    • Open a file and buffer the entire file into memory
  • $regex_replace(string, string)
    • Same as $replace(), but the pattern is a regex expression

Array Methods

Array methods return arrays

  • @split(string, opt) -> array
  • @bytes(string) -> array
  • @chars(string) -> array
  • @graphemes(string) -> array
  • @reverse(array) -> array
  • @lines(string) -> array
    • Split a given string by newlines
  • @filter(array, string) -> array
    • Apply a filter command to each element in the array
    • Exit status determines which values to filter
    • @filter(array, x => matches $x '([F])\w+')
  • @map(array, string) -> array
    • Apply a command to each element in the array
    • Output of the command is the new value for that index
    • @map(array, x => calc $x + $x)
  • @open(array, opt) -> array
    • If no pattern string is supplied, split the file by newlines
  • @split_at(string, n) -> [string, string]
    • Splits a string into a two-element array; Rust's std
  • @split_args(string)
    • Provides an interface for the ArgumentSplitter functionality in the shell.
Edited Jun 17, 2018 by Michael Aaron Murphy
Assignee
Assign to
Ion Shell v1.0.0
Milestone
Ion Shell v1.0.0
Assign milestone
Time tracking
None
Due date
None
Reference: redox-os/ion#441