Cantino | C course for the Arduino
kandi X-RAY | Cantino Summary
kandi X-RAY | Cantino Summary
C++ course for the Arduino
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Cantino
Cantino Key Features
Cantino Examples and Code Snippets
Community Discussions
Trending Discussions on Cantino
QUESTION
I'm trying to remove empty
tags from a document using Nokogiri based gem, ruby-readability. Using .strip.empty?
in the console is working fine like this:
ANSWER
Answered 2021-Jan-30 at 20:0532
decimal is 0x20
in hex or "\u0020"
, that's a single space in UTF-8 and String#strip
knows what to do with it. The bytes [194, 160]
are "\u00a0"
which is a non-breaking space: it looks like a space but String#strip
won't recognize it as whitespace because:
Whitespace is defined as any of the following characters: null, horizontal tab, line feed, vertical tab, form feed, carriage return, space.
You could use the whitespace character property instead of #strip
:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Cantino
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page