Skip to content

Instantly share code, notes, and snippets.

View waylonis's full-sized avatar
💭
Working for the man

Daniel Waylonis waylonis

💭
Working for the man
View GitHub Profile
@waylonis
waylonis / palindrome.swift
Created January 27, 2020 21:35
Swift code to check if a string is a palindrome
func isPalindrome(sequence: String) -> Bool {
// Start the indexes at the beginning and ending of the string
var findex = sequence.startIndex;
var bindex = sequence.index(before: sequence.endIndex);
// While they don't meet, check if the characters match
while findex < bindex {
if sequence[findex] != sequence[bindex] {
return false
}

Keybase proof

I hereby claim:

  • I am waylonis on github.
  • I am waylonis (https://keybase.io/waylonis) on keybase.
  • I have a public key whose fingerprint is C83C 8CFE 522C 9519 9D5B 191A 5046 DE30 C493 BE44

To claim this, I am signing this object: