Skip to content

Commit

Permalink
rename deleteAt to deleteAtChar
Browse files Browse the repository at this point in the history
  • Loading branch information
bastie committed Sep 10, 2024
1 parent 64dce24 commit 04c375e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Sources/JavApi/lang/StringBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ public class StringBuilder {
return self
}

public func deleteAt (_ offset : Int) throws -> StringBuilder {
public func charAt (_ offset : Int) throws -> Character {
guard offset > -1, offset < self.count else {
throw java.lang.Throwable.IndexOutOufBoundsException(offset, "the index is negative or greater than or equal to count of String")
}
return Array (self.content)[offset]
}

public func deleteCharAt (_ offset : Int) throws -> StringBuilder {
guard offset > -1, offset < self.count else {
throw java.lang.Throwable.IndexOutOufBoundsException(offset, "the index is negative or greater than or equal to count of String")
}
Expand Down

0 comments on commit 04c375e

Please sign in to comment.