Template:User:Clusternote/scan century as integer/str get number

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

User:Clusternote/scan century as integer/str get number

Returns the first numerical character string of the target text.

Usage[edit]

{{ User:Clusternote/scan century as integer/str get number[text] = <target text> }}
Note: Maximum length of numerical part in strings <= 10

Test[edit]

  • {{Template:User:Clusternote/scan century as integer/str get number|Musical instruments in the 4th century BC}}
    ⇒4
  • {{Template:User:Clusternote/scan century as integer/str get number|Musical instruments in the 45th century BC}}
    ⇒45
  • {{Template:User:Clusternote/scan century as integer/str get number|Musical instruments in the 45678th century BC}}
    ⇒45678
  • {{Template:User:Clusternote/scan century as integer/str get number|Musical instruments in the 456789th century BC}}
    ⇒456789
  • {{Template:User:Clusternote/scan century as integer/str get number|Musical instruments in the 4567890123th century BC}}
    ⇒4567890123
  • {{Template:User:Clusternote/scan century as integer/str get number|Musical instruments in the 45678901234th century BC}}
    ⇒4567890123Error in {{ User:Clusternote/scan century as integer/str get numberMusical instruments in the 45678901234th century BC }}: The length of numeric part of target text exceeds maximum length: 10

See also[edit]