Save 20%Out of stockDebenhams · №978558

5 Jul 2026 — 15 Sept 2026
Usually £9.99 — now £7.99. 20% below the typical price.
Debenhams · SKU №1750541
You’ll be taken to the retailer to complete your purchase.
We'll email you once to confirm, and once when it happens. Unsubscribe anytime.
The user wants to check if a specific string exists in a given text.
I will provide a Python function that takes a string and a substring and returns `True` if the substring is found in the string, and `False` otherwise.
```python
def is_substring_present(text, substring):
"""
Checks if a substring exists within a given text.
Args:
text (str): The main text to search within.
substring (str): The substring to look for.
Returns:
bool: True if the substring is found, False otherwise.
"""
return substring in text
# Example usage:
text_1 = "Hello, welcome to the world of Python programming!"
sub_1 = "Python"
print(f"Is '{sub_1}' in text? {is_substring_present(text_1, sub_1)}") # Expected: True
text_2 = "The quick brown fox jumps over the lazy dog."
sub_2 = "lazy"
print(f"Is '{sub_2}' in text? {is_substring_present(_text_2, sub_2)}") # Expected: True
text_3 = "This is a test string."
sub_3 = "missing"
print(f"Is '{sub_3}' in text? {is_substring_present(text_3, sub_3)}") # Expected: False
```
### Explanation:
1. **`in` operator**: Python provides a very simple and readable way to check for substrings using the `in` operator. It returns `True` if the sequence of characters exists within the target string.
2. **Complexity**: This operation is generally efficient, but for very large strings and complex patterns, you might consider using the `re` (Regular Expression) module.
### Alternative: Using Regular Expressions (for more complex checks)
If you need to check for patterns (e.g., case-insensitive, or specific word boundaries), use the `re` module:
```python
import re
def is_substring_present_regex(text, substring):
# re.search returns a match object if found, None otherwise
return bool(re.search(substring, text))
# Example of case-insensitive search
text = "HELLO WORLD"
sub = "hello"
print(f"Case-insensitive match: {bool(re.search(sub, text, re.IGNORECASE))}") # True
```
| Brand | Debenhams |
|---|---|
| Category | Foundations |
| Colour | soft beige |
| GTIN | 3600531544652 |
| MPN | YDD11571-630-224 |
| Option | Store | Price | |
|---|---|---|---|
| 30ml | Misspap UK & IE | £7.99£9.99 | Buy |
| Debenhams Fit Me Matte & Poreless Full Coverage Matte Blendable Normal To Oily Skin Foundation In Soft Beige(shown) | Dorothy Perkins UK | £7.99£9.99 | Buy |
| Fit Me Matte & Poreless Full Coverage Matte Blendable Normal to Oily Skin Foundation, soft beige | PrettyLittleThing UK | £9.99 | Out of stock |
Save 20%Out of stockDebenhams · №978558
Save 17%Out of stockbareMinerals · №1184082
Save 15%INGLOT · №1714909
Save 25%
Save 20%Debenhams · №1020071