Skip to content

A Category of NSString used for mutual converting between simplified Chinese and Traditional Chinese.

License

Notifications You must be signed in to change notification settings

jwliang1226/FGReverser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3320a9e · Jun 6, 2018

History

22 Commits
Jun 6, 2018
Jun 6, 2018
Jun 6, 2018
Jun 6, 2018
Jun 6, 2018
Sep 7, 2016
Jun 6, 2018

Repository files navigation

FGReverser


Introduction

A Category of NSString used for mutual converting between simplified Chinese and Traditional Chinese.

Installtion

  • Manual: Download This Project and drag the FGReverser folder into your peroject, do not forget to ensure "copy item if need" being selected.

  • Cocoapods:

pod 'FGReverser', '~> 2.0'

Usage

Just import the header file:import "NSString+FGReverser.h"

Simplfied Chinese to Traditional Chinese, or Traditional Chinese to Simplfied Chinese, Use:

-(NSString *)reverseString;

Example

NSString *sourceString=@"恭喜发财";
NSString *reslutString=[sourceString fg_reversed];
NSLog(@"%@",reslutString);

The result is 恭喜發財

NSString *sourceString=@"恭喜發財";
NSString *reslutString=[sourceString fg_reversed];
NSLog(@"%@",reslutString);

The result is 恭喜发财

Use in Swift

import UIKit
import FGReverser

class ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        var str = "恭喜发财"
        str = str.fg_reversed()!
        print(str)
        str = str.fg_reversed()!
        print(str)
    }
}

result is:

恭喜發財 恭喜发财

About Me


@CGPoitZero

About

A Category of NSString used for mutual converting between simplified Chinese and Traditional Chinese.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published