<p>With squid, we can cache webpages. I am not sure if it provides the same number of caching methods as ASP.NET caching (I primarily use ASP.NET), but it's a tool to cache webpages.</p>

<p>Then we have memcached, which can cache database tables. I believe this is correct, and it is like SqlCacheDependency (correct me if I am wrong).</p>

<p>However, is there any situation in a large web application where one would find room to use memcached, squid, AND ASP.NET (or PHP, JSP - application framework-level) caching.</p>

<p>Thanks!</p>

Try the method
```
rstrip()
```
(see doc
Python 2
and
Python 3
)
```
```
>>> 'test string\n'.rstrip()
'test string'
```
```
Python's
```
rstrip()
```
method strips
all
kinds of trailing whitespace by default, not just one newline as Perl does with
```
chomp
```
.
```
```
>>> 'test string \n \r\n\n\r \n\n'.rstrip()
'test string'
```
```
To strip only newlines:
```
```
>>> 'test string \n \r\n\n\r \n\n'.rstrip('\n')
'test string \n \r\n\n\r '
```
```
In addition to
```
rstrip()
```
, there are also the methods
```
strip()
```
and
```
lstrip()
```
. Here is an example with the three of them:
```
```
>>> s = "   \n\r\n  \n  abc   def \n\r\n  \n  "
>>> s.strip()
'abc   def'
>>> s.lstrip()
'abc   def \n\r\n  \n  '
>>> s.rstrip()
'   \n\r\n  \n  abc   def'
```
```