Skip to content

Commit 75f7683

Browse files
author
Jan Guegel
committed
fix double spaces in fullName by cleaning with regex
1 parent 2af4c92 commit 75f7683

File tree

1 file changed

+1
-1
lines changed
  • commons/src/main/kotlin/org/fossify/commons/models/contacts

1 file changed

+1
-1
lines changed

commons/src/main/kotlin/org/fossify/commons/models/contacts/Contact.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ data class Contact(
173173
}
174174
val lastPart = if (startWithSurname) firstMiddle else surname
175175
val suffixComma = if (suffix.isEmpty()) "" else ", $suffix"
176-
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim()
176+
val fullName = "$prefix $firstPart $lastPart$suffixComma".trim().replace(Regex("\\s+"), " ")
177177
val organization = getFullCompany()
178178
val email = emails.firstOrNull()?.value?.trim()
179179
val phoneNumber = phoneNumbers.firstOrNull()?.normalizedNumber

0 commit comments

Comments
 (0)