Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
stringmanipulate
Readme
This Python package provides a collection of string manipulation functions, including grouping anagrams, checking string inclusions, decoding strings, and finding the length of the longest substring without repeating characters.
To install this package, run the following command in your terminal:
pip install stringmanipulate
groupAnagrams(strs: List[str]) -> List[List[str]]
: This function takes a list of strings and groups anagrams together. An anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. It returns a list where each element is a list of anagrams.
from stringmanipulate import groupAnagrams
# Example usage:
print(groupAnagrams(["bat", "tab", "eat", "tea", "tan", "nat"]))
# Output: [["bat", "tab"], ["eat", "tea"], ["tan", "nat"]]
checkInclusion(s1: str, s2: str) -> bool
: This function checks if one string (s1) is a permutation of any substring of another string (s2). It returns True if any permutation of s1 can be found as a substring in s2, otherwise False.
from stringmanipulate import checkInclusion
# Example usage:
print(checkInclusion("ab", "eidbaooo"))
# Output: True
lengthOfLongestSubstring(s: str) -> int
: This function finds the length of the longest substring without repeating characters in a given string (s). It returns the maximum length of such substrings.
from stringmanipulate import lengthOfLongestSubstring
# Example usage:
print(lengthOfLongestSubstring("abcabcbb"))
# Output: 3
decodeString(s: str) -> str
: This function decodes a string that follows a specific pattern where k[encoded_string] indicates that the encoded_string within the square brackets should be repeated k times. It returns the fully decoded string.
from stringmanipulate import decodeString
# Example usage:
print(decodeString("3[a]2[bc]"))
# Output: "aaabcbc"
To contribute to this project, please follow these steps:
git clone https://github.com/software-students-fall2023/3-python-package-exercise-team-dominators-1.git
python -m venv venv
source venv/bin/activate
Pipfile
:
pip install pipenv
pipenv install
python setup.py sdist bdist_wheel
python -m unittest discover
This package is also available on PyPI:
FAQs
A package that provide basic string manipulation functions
We found that stringmanipulate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.