📜  红宝石 | StringScanner 检查函数

📅  最后修改于: 2022-05-13 01:55:15.241000             🧑  作者: Mango

红宝石 | StringScanner 检查函数

StringScanner#inspect() :inspect()是一个 StringScanner 类方法,它返回表示显示不同值的 StringScanner 对象的字符串。

示例 #1:

# Ruby code for StringScanner.inspect() method
  
# loading StringScanner
require 'strscan'
  
# declaring StringScanner 
c = StringScanner.new("Mon Sep 12 2018 14:39")
  
# inspect() method
puts "String Scanner inspect form : #{c.inspect()}\n\n"

输出 :

String Scanner inspect form : #

示例 #2:

# Ruby code for StringScanner.inspect() method
  
# loading StringScanner
require 'strscan'
  
# declaring StringScanner 
c = StringScanner.new("hellogeeks")
  
# inspect() method
puts "String Scanner inspect form : #{c.inspect()}\n\n"

输出 :

String Scanner inspect form : #