添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
无邪的丝瓜  ·  Asynchronous ...·  3 天前    · 
坚韧的凉面  ·  spring-boot-dependenci ...·  4 月前    · 
性感的鞭炮  ·  Mace Library: ...·  4 月前    · 
霸气的胡萝卜  ·  vue.js let是什么 • ...·  5 月前    · 

// Tutorial //

Scala slice function

Published on August 3, 2022
Default avatar

By Rambabu Posa

Scala slice function

While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.

Today we will look into Scala slice function.

Scala slice

  • Scala Array API
  • String API
  • Scala Collection API
  • We will pick-up each API and discuss them in-depth with suitable examples in next section.

    Scala slice function usage

    S.No.
    Function Params
    Usage
    First Parameter
    Starting index (Inclusive). It should be zero or any any positive integer less than the length of the Collection or String or Array.
    Second Parameter
    Ending index (Exclusive).
    

    slice function extract elements starting from ‘first-index’ (Inclusive) to ‘until-index’ (exclusive). Here elements numbers for an Array of Numbers, Characters for a String, an object for a Collection.

    Scala Array Slice

    Scala Collection slice

    Scala String slice