How to get last 2 digit from a String

user2809386

I have a problem to get last two digit from a string.

example :

String texter = "5793231309"

how to get '09' ? so when Iprintln "texter : "+texter. It will be Groovy<<09

I try split but it not successful ?

Lukas Warsitz

Use this to split your first String:

static main(args) {

    String texter = "5793231309"
    String texter2 = texter[-2..-1]

    println(texter2)
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

function to get second largest digit from a string

From Java

How to get digit values from String?

From Dev

NSNumberFormatter: Displaying zero as last digit starting from a string like 25.0

From Dev

Get pairs of digit from string with regexp

From Dev

Javascript - How to get the last digit after decimal number?

From Dev

How to get the date from a 5 digit number

From Dev

How to get the last three digit before a character in PHP

From Dev

How to get Last digit of number

From Dev

How do I get just the last digit in a number?

From Dev

How to get last 4 digit of number in android?

From Dev

How to extract last digit from string which contains chars and numbers

From Dev

Extract digit from string and transfer into 2 decimal

From Dev

How to increase only last digit of a serial number string in Excel VBA?

From Dev

Get last number from string

From Dev

Get pairs of digit from string with regexp

From Dev

how can i get single digit from four digit

From Dev

get the last digit from the name

From Dev

How to obtain all 1 digit or adjoining 2 digit combinations of a string

From Dev

how to remove space and repeated digit from string

From Dev

How to take two digit from string in java?

From Dev

How to extract last digit from string which contains chars and numbers

From Dev

how to get the lowercase string and digit string from the string line then put them into a List?

From Dev

How do i get the last digit of the current year in PHP

From Dev

How to get day (2-digit) from date string

From Dev

How to get the last index from a String in a for loop

From Dev

How to use sed to modify last 2 digit of a line when a string matches in a file

From Dev

how to get last character from a string in mongodb?

From Dev

how to get the last digit from format like ip address javascript?

From Dev

Slice string at last digit in Python

Related Related

  1. 1

    function to get second largest digit from a string

  2. 2

    How to get digit values from String?

  3. 3

    NSNumberFormatter: Displaying zero as last digit starting from a string like 25.0

  4. 4

    Get pairs of digit from string with regexp

  5. 5

    Javascript - How to get the last digit after decimal number?

  6. 6

    How to get the date from a 5 digit number

  7. 7

    How to get the last three digit before a character in PHP

  8. 8

    How to get Last digit of number

  9. 9

    How do I get just the last digit in a number?

  10. 10

    How to get last 4 digit of number in android?

  11. 11

    How to extract last digit from string which contains chars and numbers

  12. 12

    Extract digit from string and transfer into 2 decimal

  13. 13

    How to increase only last digit of a serial number string in Excel VBA?

  14. 14

    Get last number from string

  15. 15

    Get pairs of digit from string with regexp

  16. 16

    how can i get single digit from four digit

  17. 17

    get the last digit from the name

  18. 18

    How to obtain all 1 digit or adjoining 2 digit combinations of a string

  19. 19

    how to remove space and repeated digit from string

  20. 20

    How to take two digit from string in java?

  21. 21

    How to extract last digit from string which contains chars and numbers

  22. 22

    how to get the lowercase string and digit string from the string line then put them into a List?

  23. 23

    How do i get the last digit of the current year in PHP

  24. 24

    How to get day (2-digit) from date string

  25. 25

    How to get the last index from a String in a for loop

  26. 26

    How to use sed to modify last 2 digit of a line when a string matches in a file

  27. 27

    how to get last character from a string in mongodb?

  28. 28

    how to get the last digit from format like ip address javascript?

  29. 29

    Slice string at last digit in Python

HotTag

Archive