Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Special character validation in swift #4

@thatswiftguy

Description

@thatswiftguy

Overview

  • Write an extension to string, that returns true and false depending upon the presence of special characters.
  • Extension should be declared as public
  • Methods or properties could be declared as static

Sample

let str1: String = "abcsg$"
str1.haveSpecialChar() // true

let str2: String = "sfasdf"
str2.haveSpecialChar() // false

Code Path

  • Sources -> Extended -> Public -> Extension -> String.swift

Discussion

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions