How to use Raw String In Swift 5?

Rlogical Techsoft
2 min readNov 18, 2019

--

We are discussing here how to use raw string usefulness in Swift 5?

Let’s go with examples

Use of # delimiter

We can use # delimiter with start and end of the strings to use less escape sequences.

Output:

This is “Swift 4.x”.

This is “Swift 5.x”.

Use of variables with # delimiter

We can use variable with string like \#(variableName)

Output:

This is “Swift 4.x” with variable.

This is “Swift 5.x” with variable.

Multiline String with # delimiter

We can use # delimiter in multiline strings too.

Output:

This is

Swift 5.

Conclusion

Swift is getting more stable day by day!

--

--

Rlogical Techsoft
Rlogical Techsoft

Written by Rlogical Techsoft

Web & Mobile App Development Company. Expertise in Mobile App, PHP, ASP .NET, MVC 5 (Razor), MongoDB, NodeJS, AngularJS, ReactJS, Windows App, POS, Scraping.

No responses yet